Layer 3 · Go deeper · 7 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 database connections does the summary endpoint hold?
200,000 restaurants poll a dashboard every 30 s. How much aggregation is that?
Build-up · 6 steps
Move the work off the primary
The same system from busy to fixed. Each step takes one kind of work off the one box you can’t scale out, and says what it costs.
Step 1 of 6
One primary, every request
Every endpoint, cron job and analyst shares one primary. It’s the only node that takes writes, and the hardest tier to scale.
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
“Your primary is at 95% CPU and the app servers are at 15%. What do you do?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“Checkout slows at peak and database CPU is high. How do you tell a busy database from a missing index or lock contention?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Finance’s 11 am dashboard runs a GROUP BY over 18 months of orders on the primary. Where should it run?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“200,000 restaurants poll an orders-per-hour dashboard every 30 seconds. How do you serve it?”
Your move. Pick an approach: