← Questions
Design live comments for a live stream
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Microsoft's technical phone screen, last asked Jan 2026. It tests real-time, fan-out and websockets.
Viewers post comments on a live video, and everyone watching sees them in near real time. Some streams have a handful of viewers; a few have millions at once. Design the system: posting, fan-out to viewers, connections, what to do when volume is too high to show everything, moderation and storage.
Requirements
- Functional: post a comment on a live stream; see new comments within a couple of seconds; load recent comments on joining; moderate (remove comments, ban users, filter); keep comments for replay.
- Non-functional: very large fan-out on popular streams; low latency; a burst of posts at a key moment must not take the system down; per-user rate limits.
Clarifying questions
- How many concurrent streams and viewers, and how many viewers on the largest stream?
- Must every viewer see every comment, or is a sample acceptable on huge streams?
- Does ordering have to be exact across viewers?
- Which moderation is needed before a comment appears versus after?
- Should comments line up with the video timeline on replay?
What a strong answer covers
- Write path: an API that authenticates, rate-limits and moderates, then appends the comment to a per-stream log or pub/sub topic and to durable storage.
- Delivery: viewers hold WebSocket or server-sent event connections to edge or gateway servers; each gateway subscribes once per stream it serves and fans out locally, so a stream with a million viewers costs one message per gateway, not per viewer.
- Connection management: gateway capacity, reconnects with a "since" position, and heartbeats.
- High volume: when a stream receives thousands of comments per second nobody can read them, so sample or rank (friends, verified, top-liked) per viewer and batch messages every few hundred milliseconds.
- Moderation: synchronous filters (blocklists, a fast classifier) before publishing, asynchronous review afterwards with deletions pushed to clients.
- Storage keyed by stream and time for replay, plus the hot-stream partitioning and backpressure story.
Follow-ups
- A celebrity stream goes from 10,000 to 2 million viewers in a minute. What scales, and what breaks first?
- A comment is removed by moderators after it was shown. How do clients learn?
- How would you show comments in sync with the video on replay?
- How do you add reactions (hearts) at much higher volume than comments?
Where it's asked
- Microsoft · Technical phone screen · Last asked Jan 202660 min · One technical round
What it tests
real-time · fan-out · websockets
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
