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.
How much does batching help one database node?
How much lag does a reconnect storm cause behind a log?
How do you cut the writes on one hot zone counter?
Build-up · 6 steps
One log, three stores shaped for their readers
The final design for delivery pings. Ingest writes once; each consumer reads the same log at its own pace and writes a store shaped for how its data is read.
Step 1 of 6
Ingest appends, then replies
The API appends each ping to a Kafka topic keyed by partner ID, with acks=all, and replies OK once the log has it. Nothing else happens in the request.
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
“One PostgreSQL node takes about 18,000 single-row writes a second, and you need 125,000. What do you change first?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“A two-minute outage ends, and 100,000 phones upload 30 buffered pings each within 20 seconds. How does ingest survive?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“The ping trail has outgrown one database. Which partition key do you shard it by?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“A viral post gets a million likes a minute, about 16,700 a second on one counter. How do you count them?”
Your move. Pick an approach: