Redis
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Layer 3 · Go deeper · 10 min

    Go deeper

    Size it, build it, then make the calls an interviewer will push you on.

    Back of the envelope

    Size it up

    Tap through each step of the arithmetic.

    How much RAM do 8 million UPI sessions need?

      How many primaries does that session store need?

        How long can a fork freeze a 24 GB instance?

          Build-up · 5 steps

          Find a key’s node in Redis Cluster

          No proxy sits in the middle. The client hashes the key, caches a slot map, and follows a redirect when that map is stale.

          Step 1 of 5

          Slots split across shards

          Every key belongs to one of 16,384 hash slots, and each primary owns ranges of them. The cluster spec suggests about 1,000 nodes at most.

          4 interview moments

          You’re the candidate

          The interviewer pushes on the hard parts. Pick an approach and see how it holds up.

          1. Deep dive 1 of 4

            Interviewer

            “Fantasy cricket, 100 million players, and points change on every wicket. How do you serve the live leaderboard?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Every API gateway must share one token bucket per client key. How do you update it safely?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “A BookMyShow-style app gives a buyer ten minutes to pay for seat B4-23. Where do the hold and the booking live?”

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “Two workers must never send the same payout. How do you lock payout 881?”

            This lock guards money, not just wasted work.

            Your move. Pick an approach:

          Build-up · 5 steps

          Lose a write Redis acknowledged

          Follow one seat write through a failover. The client does nothing wrong; asynchronous replication is the whole story.

          Step 1 of 5

          The primary says OK

          Redis acknowledges a write once it is in the primary’s memory, and replies without waiting for any replica.