Take a minute. I'd like you to design the notification fanout for a service at Twitter's scale. Roughly a billion users, a mix of celebrities and ordinary accounts. Start wherever you like.
Okay. So before I go anywhere, I want to clarify the read pattern. Are we optimizing for fanout-on-write — push notifications into a per-user inbox at the moment a tweet is posted — or fanout-on-read, where the inbox is materialized when the user opens the app?
Good question. Assume both will be present in the real system. Tell me where you'd draw the line.
The line I'd draw is at follower count. For accounts under, say, ten thousand followers, fanout-on-write into per-user inboxes is fine — that's the ninety-five percent case and the inbox write is bounded. For accounts above that — the celebrity tier — we flip to fanout-on-read and merge their tweets in at read time. The threshold is tunable
You opened with a clarification — a strong move — but you spent forty-one seconds before stating a quantitative read of the workload. Strong candidates land a read/write ratio inside the first ninety seconds. Without that anchor the rest of the answer drifts; the interviewer has nothing to push you on except the absence of the number.
"Okay. So before I go anywhere, I want to clarify the read pattern. Are we optimizing for fanout-on-write — push notifications into a per-user inbox at the moment a tweet is posted — or fanout-on-read, where the inbox is materialized when the user opens the app?"
State the ratio upfront. "At a billion users with a power-law follower distribution, this is read-dominated — call it twenty reads per write at the median user and a hundred at the celebrity tier." Then clarify. The number is the anchor that lets the interviewer trust the rest.
| Drill | Track | Bar | Duration | Framing | Signal | Recovery | Date |
|---|---|---|---|---|---|---|---|
| Notification fanout (Twitter) | System design | Staff | 28m | ● | ● | ● | 24 May |
| Rate limiting Stripe's API | System design | Staff | 31m | ● | ● | ● | 22 May |
| Coffee chain in Lisbon | Case math | Senior | 24m | ● | ● | ● | 20 May |
| Disagreed with your manager | Behavioral | Staff | 15m | ● | ● | ● | 17 May |