Layer 3 · Go deeper · 11 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 connections does the notification tier hold?
How much data does the block store hold?
How many shards does the metadata store need?
Build-up · 5 steps
Build the high-level design
One functional requirement at a time, ending with a design that works for one region at moderate scale.
Step 1 of 5
Upload and download any file
The client talks to metadata only in hashes. The first commit asks which blocks are missing; bytes go straight to the block store; the second commit appends a journal row, so no device sees half a file.
6 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 6
Interviewer
“A 50 GB video takes 67 minutes on a 100 Mbps uplink, and home Wi-Fi drops. How do you upload it?”
Your move. Pick an approach:
Deep dive 2 of 6
Interviewer
“A viral PDF is stored by a million users. Should identical blocks be stored once across everyone?”
Your move. Pick an approach:
Deep dive 3 of 6
Interviewer
“150 million devices are online at peak, and nearly all have nothing new to learn. How do they hear about changes?”
Your move. Pick an approach:
Deep dive 4 of 6
Interviewer
“Asha edits budget.xlsx on a flight; Ravi edits it in the office. Both started from revision 17. Whose version wins?”
Your move. Pick an approach:
Deep dive 5 of 6
Interviewer
“Metadata is about 1 PB, 35k commits a second at peak, strongly consistent within a namespace. What’s your shard key?”
Your move. Pick an approach:
Deep dive 6 of 6
Interviewer
“You hold 5 EB of blocks, and over 90% of retrievals are for data from the last year. How do you protect them?”
Your move. Pick an approach:
Build-up · 8 steps
Follow one edit from Asha to Ravi
The metadata plane is small and strongly consistent; the block plane is huge and dumb. The change stream and notifier connect them without carrying any content.
Step 1 of 8
Commit
Asha saves q3-forecast.xlsx. Her client hashes its 4 MB blocks and commits the blocklist through the API gateway, naming parent revision 17.