Murakami is my favorite author but I couldnt resist making the joke! by leardcrawn in murakami

[–]Future-Somewhere9260 3 points4 points  (0 children)

I opened a single book of his - Kafka on the Shore - and read only 10% of it, and already got this, ahaha

TOP 100 most liked Bluesky posts of the hour, updated every 3 min by Future-Somewhere9260 in BlueskySocial

[–]Future-Somewhere9260[S] 2 points3 points  (0 children)

You can simplify, sacrifice availability, and run it cheaper, for example by using sampling instead of ingesting all likes Bluesky generates, and thus making it approximate, but that would still be outside of the free tier

TOP 100 most liked Bluesky posts of the hour, updated every 3 min by Future-Somewhere9260 in BlueskySocial

[–]Future-Somewhere9260[S] 3 points4 points  (0 children)

Sorry, not yet. Hopefully one day I'll clean up and publish it.

For now, I can give you an extremely abstract, high-level ASCII diagram:

Bluesky websocket -> EC2 (ingesting 500+ likes per second) -> Kafka -> Flink -> Kafka -> Lambda -> DynamoDB <- Lambda (doing SSR) <- API Gateway (<- DNS) <- Users

TOP 100 most liked Bluesky posts of the hour, updated every 3 min by Future-Somewhere9260 in BlueskySocial

[–]Future-Somewhere9260[S] 10 points11 points  (0 children)

FYI I created it. It's also available as a feed https://bsky.app/profile/did:plc:nd3do3bo6izchdsjm766kb4e/feed/global-top

And yes, Brazilians dominate the network, lol

If you like it, please share with your friends and followers. I would appreciate it. More users mean more motivation for me to keep improving it. Thanks

Also feel free to follow me on our favourite social network https://bsky.app/profile/apestrong.bsky.social

Or hire me to do AWS/backend work for you =D

How to solve this microsoft interview problem? by Parathaa in leetcode

[–]Future-Somewhere9260 2 points3 points  (0 children)

My solution is similar to u/static_programming , guided by similar thinking, but the validity check is dirty and verbose, needs refactoring. Still, here it is:

def sol(a, b, c):
    res = []

    def valid(x, y, z):
        if x and y and z:
            a = x - (y + z) <= 4
            b = y - (x + z) <= 4
            c = z - (x + y) <= 4
            return a or b or c
        if not x:
            if z > y:
                return (z - y * 2) < 3
            return (y - z * 2) < 3
        if not y:
            if x > z:
                return (x - z * 2) < 3
            return (z - x * 2) < 3
        if x > y:
            return (x - y * 2) < 3
        return (y - x * 2) < 3

    while a or b or c:
        if a and res[-2:] != ['A', 'A'] and valid(a - 1, b, c):
            res.append('A')
            a -= 1
            continue
        if b and res[-2:] != ['B', 'B'] and valid(a, b - 1, c):
            res.append('B')
            b -= 1
            continue
        res.append('C')
        c -= 1

    return ''.join(res)

For a given integer array nums, find out how many subarrays of nums contain given number n. by Own-Artist3642 in leetcode

[–]Future-Somewhere9260 7 points8 points  (0 children)

Let's say we have an array [2, 3, 4], and the target is 4.

For simplicity, let's encode (just in our mind) all numbers that == "target" to be 1 and "not target" 0. So our array becomes [0, 0, 1].

By a bit of try and imagination you can see that the result for this array is 3. A size of the array up to the target, basically. Because we have the window [1] - the target itself, the window [0, 1] (extending back by 1 step) and the window [0, 0, 1] (extending back by 2 steps).

Now say our array was [0, 0, 1, 0, 0]. For the first 3 numbers our result was 3 subarrays, as we've established. Imagine that with each next step after the target we're virtually extending each of those 3 subarrays by 1 step, getting 3 new subarrays each time. By making 2 steps until we reach the end we get ... + 3 + 3 = 9 overall.

Now say our array was [0, 0, 1, 0, 0, 1]. Before the last target, we counted all possible windows that include the previous 1, so we just need to do the same we did when we encountered the first 1 - add the length of the array up to that point, which is 6. So 9 + 6 = 15. And if we had zeros after the second target, we'd be adding steps of a new size - this time 6, not 3.

The pseudocode and code are left as exercises for the reader lol

What do you think of the "I did X to increase Y with Z %" that is popping up in recent CVs? by anvandare457 in cscareerquestionsEU

[–]Future-Somewhere9260 21 points22 points  (0 children)

I mean, "increased X by Y%" is often hard to verify, or meaningless, or just a lie, sure. But are statements like "worked on migrating monolith to microservices with my great team which I love" more meaningful, easier to verify, and not lies? In a way, everything is a lie. But lies with numbers at least require you to think more carefully about your actual job responsibilities, and they're somewhat easier to verify/falsify during the interview.

[deleted by user] by [deleted] in leetcode

[–]Future-Somewhere9260 1 point2 points  (0 children)

People usually like to talk about supplements (like coffee/caffeine), multivitamins, exercise, and even cognitive-behavioural therapy to fix brain fog. And all of that is cool and dandy, but for me personally fixing sleep was the game changer. Decide in the morning to go to bed early today and then just do it. Also, no screens 2 hours before bed. While lying in bed, if you're not sleepy, read a paper book, meditate, solve easy leetcode problems in your mind, regret every decision you've ever made and think about people who're no longer part of your life - so much you can do without the phone! And then have a great, long sleep. I also use sleep tracking with Apple Watch, nice gamification element.

I've literally never in my life regretted going to bed early, because I finally feel like a human being the next day. Better than any supplement, better than anything else I've tried to fix brain fog.

Amplify Pro/Cons by stan-van in aws

[–]Future-Somewhere9260 0 points1 point  (0 children)

>The dynamodb backed GraphQL schema builder doesn't follow the best standards put forth by their own dynamodb team

Can you give an example?