← Questions
Design live comments for live videos
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Meta's system design round, last asked Apr 2026. It tests real-time, pub/sub and websockets.
Design real-time comments on live video broadcasts (or any very popular post). Viewers post comments, and everyone watching the same stream sees new ones appear within a second or two, even when one stream has millions of viewers at once.
Requirements
- Functional: post a comment on a live stream; deliver new comments to all current viewers in near real time; show recent comments to someone who just joined; moderate and remove comments; keep comment history after the stream.
- Non-functional: delivery within 1-2 seconds; millions of concurrent viewers on a single hot stream; many streams at once; graceful degradation under load; durability of accepted comments.
Clarifying questions
- How many concurrent viewers on the largest stream, and how many comments per second at peak?
- Must every viewer see every comment, or is sampling acceptable on huge streams?
- Does order matter strictly, or is roughly chronological fine?
- How fast must moderation take effect: before display, or removal after?
- Which clients: web, mobile, TV?
What a strong answer covers
- Write path: an API that validates, rate-limits and stores the comment durably, then publishes it to a channel for that stream.
- Delivery: persistent connections from clients to a fleet of edge or gateway servers; each server subscribes to the streams its viewers watch (pub/sub partitioned by stream id) and pushes to its own connections.
- Transport: long polling versus Server-Sent Events versus WebSockets, compared on latency, overhead and client support, and a choice.
- Hot streams: a fan-out tree (publisher to many relay servers to edges), batching comments per interval, and sampling or ranking comments when the rate exceeds what anyone can read.
- Ordering and late joiners: server timestamps or per-stream sequence numbers; a recent-comments buffer in cache for new viewers.
- Moderation and storage: pre-display filters for clear abuse, asynchronous review with removal events pushed to clients; history in a store partitioned by stream.
Follow-ups
- A celebrity stream reaches 5 million viewers and 50,000 comments per second. What changes?
- A gateway server dies, dropping 100,000 connections. What happens and how do clients recover?
- How do you show a viewer's own comment instantly even when the stream is sampled?
- How would you add reactions (hearts) at much higher rates than comments?
Where it's asked
- Meta · System design · Last asked Apr 202645 min · Design discussion; either an LLM-agent system or a classic product system · Nominally AI-enabled, but the assistant is often not used
What it tests
real-time · pub/sub · websockets · fan-out
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
