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 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.
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:
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:
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:
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.