Design the live chat system for a streaming platform like Twitch or YouTube Live. During a popular stream, up to 500,000 concurrent viewers send and receive chat messages in a single channel. Messages must appear on viewers' screens within 1 second. The system supports emotes, subscriber badges, moderator actions (ban, timeout, delete message), and slow mode (rate limiting per user).
In your 90-second answer, cover: - How you fan out messages to 500K viewers in a single channel with < 1 second latency - Connection management at scale (500K WebSocket connections per stream) - Moderation pipeline: real-time content filtering and moderator actions - Chat replay: storing and serving chat for VOD (video on demand) playback - How your design differs from a regular chat system (1-to-1 or small group)
Constraints: peak message rate is 10,000 messages/second in a single channel. Not every viewer needs to see every message (message sampling is acceptable above a threshold).
How to approach it
- Hint 1
Unlike a regular chat where every message must be delivered, live chat at this scale requires controlled fan-out. Consider partitioning viewers into groups that each receive a subset of messages -- viewers will not notice missing some messages in a fast-scrolling chat.
- Hint 2
Do not maintain one WebSocket connection per viewer to a single server. Use a hierarchical fan-out: a small number of origin servers feed messages to many edge servers, which serve viewers.
- Hint 3
Moderator actions (bans, message deletion) must propagate globally and immediately. Think about how a ban event reaches all edge servers so the banned user is blocked everywhere.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.