Layer 3 · Go deeper · 8 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.
What do 1 KB JWTs cost at 50,000 requests a second?
How many socket gateways for 10 million concurrent users?
Build-up · 5 steps
Move the state out of the app
Start with sessions in each instance’s memory behind a sticky balancer. Kill one, then move the state somewhere built for it.
Step 1 of 5
Sessions in memory
Each instance keeps its users’ sessions in its own memory, so a sticky balancer must send every user back to the same instance.
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
“Sessions live in app memory behind sticky load balancing. A big sale is coming and autoscaling will add instances. What do you change?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“Your mobile login uses JWTs. Security wants logout and bans to take effect quickly. What do you do?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“You’re building a WhatsApp-style chat for 10 million concurrent users. Where does the state live?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“Your API’s rate limiter counts requests in each instance’s memory. You scale from 1 instance to 10. What happens?”
Your move. Pick an approach: