Layer 3 · Go deeper · 9 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 does a 100M-DAU photo app store a year?
How big is a URL shortener’s cache?
How many shards does the payment ledger need?
Build-up · 6 steps
Size a URL shortener, box by box
Each component is sized by one estimate, and one estimate turns out not to matter at all.
Step 1 of 6
State the assumptions
100 million new links a month, each clicked 100 times, 500 bytes a record, three copies, five years. That’s 40 writes and 4,000 reads a second on average.
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
“You’re about to estimate five years of storage. What do you say before the arithmetic?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“A tatkal-style booking window opens at 10 am. How do you size for the first five minutes?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“The ledger has 90 partitions of 1,000 writes a second each. One large merchant receives 5% of all payments.”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“The interviewer says your link shortener gets 400 writes a second, not 40. Do you redesign?”
Your move. Pick an approach: