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.
Can FCM’s default allowance carry 100M users in 30 minutes?
What does SMS cost, and why is it kept for OTPs?
How many push workers does the peak need?
Build-up · 6 steps
Build the high-level design
One functional requirement at a time, ending with a platform that works for one region at moderate traffic.
Step 1 of 6
To a user, not a device
The API validates, records the idempotency key, appends to Kafka and returns 202, so callers never wait on providers’ 100–500 ms. An orchestrator finds the user’s devices and writes one delivery per channel.
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
“At 19:07 a sale sends 100M pushes and 20M promotional SMS. At 19:08 Priya asks for a login OTP. Where does it queue?”
Your move. Pick an approach:
Deep dive 2 of 6
Interviewer
“Marketing wants a sale push to 100M users in about 30 minutes, with a stop button that works. How do you send it?”
Your move. Pick an approach:
Deep dive 3 of 6
Interviewer
“80 push workers share one FCM allowance, and an SMS aggregator just started timing out. How do workers talk to providers?”
Your move. Pick an approach:
Deep dive 4 of 6
Interviewer
“A worker hands a push to FCM and crashes before committing its offset. Another send times out. What do you build?”
Your move. Pick an approach:
Deep dive 5 of 6
Interviewer
“Forty teams each send one promotion a day. The rule is at most three a day per user. Where do you enforce it?”
Your move. Pick an approach:
Deep dive 6 of 6
Interviewer
“People switch phones, uninstall, and log in on each other’s phones. How do you keep push tokens pointing at the right person?”
Your move. Pick an approach:
Build-up · 8 steps
Follow one “out for delivery” through it
The hot path is API, log, orchestrator, lanes and channel workers. Campaigns enter through the same log; everything reporting back flows into one status topic.
Step 1 of 8
Produce
The order service commits “out for delivery” and an outbox row in one transaction. A relay calls the API with the row ID as the idempotency key, so a crash can’t separate the two.