Capacity Planning
Design live comments on a live broadcast: viewers type short comments, and every viewer watching sees new comments stream in near-real-time.
In scope: posting a comment on a broadcast, broadcasting new comments to every connected viewer in near-real-time, and delivering a readable stream even when comments arrive faster than anyone can read. Out of scope: long-term comment history and search, machine-learning moderation, and the live video stream itself.
Scale and usage:
Assume one popular broadcast has roughly ten million concurrent viewers, each holding one persistent connection — an illustrative anchor, not a measured fact. That alone is the number that breaks a naive single-server design. Say comments spike to roughly two thousand a second at a peak moment. Delivering every comment to every viewer would mean 10M × 2,000/s = 20 billion deliveries a second for this one broadcast — a rate no fan-out tier could serve, and one no person could read anyway. A person can realistically read on the order of ten comments a second, so capping delivery there instead gives 10M × 10/s = 100 million deliveries a second — still large, but now fixed by viewer count and the readable cap, independent of how fast comments actually arrive. Connections, more than requests per second, set the server count on the gateway tier — CPU for TLS and egress bandwidth are the other sizing dimensions at high delivered rates. Assume, as another illustrative anchor, roughly a hundred thousand connections per gateway server — at that figure, a hundred gateways cover ten million connections, this one broadcast's audience, before counting every other broadcast live on the platform at the same time.
What a strong answer sounds like
State the decision, connect it to a requirement, and name the tradeoff. Ask the interviewer for any product facts you need (users, usage, scale, targets) — they will answer. Keep the design focused on the workload.
The AI interviewer asks about this part of Design Live Comments (Real-Time Fan-Out). The interviewer guides you through topics one by one.