Design a live video comments system: the system design interview walkthrough
The request to design a live video comments system — the comments streaming up the side of a live broadcast — looks like a chat box. The scale is what turns it into an interview: a popular stream has millions of people watching the same moment, every one of them seeing a flood of new comments in near-real-time, and a huge world-cup-final stream can push thousands of comments a second to hundreds of millions of screens at once. The naive answer — have each client poll for new comments and show them all — collapses twice over: polling millions of viewers hammers your servers, and at thousands of comments a second no human can even read what you'd be delivering. So the real design is a real-time fan-out system that pushes comments out efficiently, routes them without every server doing every stream's work, and — crucially — changes its own goals when a stream gets huge. This is a sharp system design interview prompt because the obvious "poll and display everything" answer is wrong at both ends, and the interesting answer bends the requirements as the scale changes.
The round turns on three decisions. First, real-time delivery — why you push comments instead of polling, which push technology fits a read-heavy stream, and why you separate read traffic from write traffic. Second, fan-out coordination — how a posted comment reaches exactly the servers holding that stream's viewers, without every server subscribing to every stream. Third, mega-streams — how the design flips to sampling and CDN snapshots when a single stream has hundreds of millions of viewers and the goal of "deliver every comment" stops making sense. This walkthrough follows the path a strong candidate draws on the whiteboard — requirements, estimate, API and data model, high-level design, then the deep dives — and at each step it names the follow-up the interviewer uses to tell a memorised answer from an engineer who understands the tradeoff.
How the live video comments round is actually run
A live comments round runs about 45 minutes on a shared canvas — you draw the boxes and arrows while you talk, and the interviewer interrupts. It is a favourite messaging-and-realtime problem because the one-line brief hides a lopsided fan-out: comments are written rarely (most viewers only read) but read by everyone, and one comment must reach millions of screens fast. The moment you say "broadcast the comment to the viewers," the real questions appear — how do you push to millions of connections, how does a server avoid handling every stream, and what do you do when one stream has more viewers than you can meaningfully serve — and the best answers recognise the problem changes shape at the top end. Get the push model, the fan-out routing and the mega-stream pivot clean and you have shown you understand real-time broadcast at scale.
The interviewer rarely lets "clients poll every second and show all the new comments" stand. "It is the world-cup final — a hundred million people are watching and comments are coming in at five thousand a second. If you push every comment to every viewer, each one is on screen for four milliseconds. What are you actually delivering, and does real-time even matter here?" That question — the requirements themselves breaking at extreme scale — is the one a copied answer can never rehearse, and the one this round is really testing.
The rounds here are modelled on how the loop runs, not scraped from any candidate's recall. What matters for prep is the shape: a blank canvas, a clock, and a follow-up after every decision you make.
The five-step framework for any HLD round
Every high-level design answer fits the same spine. Say it out loud at the start so the interviewer knows you have a plan, then walk it:
- Clarify requirements — the read/write imbalance, the latency target, and whether comments must be durable.
- Estimate — viewers per stream, comments per second, and the fan-out ratio, to justify the push model.
- High-level design — the boxes and arrows: viewers, realtime messaging servers, the comment write path, pub/sub.
- Deep dive — the two or three decisions that actually decide this system.
- Follow-ups — bottlenecks, failure modes, and what you would change at ten times the scale.
What the debrief measures
The score is not "right or wrong design." A good HLD debrief reads on four dimensions, and every move below maps to one: problem solving (did you push instead of poll and separate read from write), communication (did you explain the read/write imbalance and why real-time stops mattering on a mega-stream, in a sentence), technical execution (SSE for one-way delivery, pub/sub with viewer co-location, sampling and CDN snapshots for mega-streams), and time management (did you spend your 45 minutes on fan-out and scale, not on the comment-moderation UI). Reading a walkthrough teaches the design; it does not teach you to deliver it on the clock while someone pushes back.
Step 1 — Requirements: what a live comments system must do
Spend the first few minutes here. Jumping to boxes before you have scoped the problem is the fastest way to design the wrong system.
| Type | Requirement |
|---|---|
| Functional | Let a viewer post a short comment on a live video; deliver new comments to everyone watching that video in near-real-time; show a recent window of comments; a viewer who joins mid-stream sees recent comments. |
| Functional (optional) | Moderation and spam filtering, reactions/likes, replies, pinned comments, replay of comments with the recorded video — call these out, then scope most of them for later. |
| Non-functional | Read-heavy and write-light (most viewers never comment, all of them read); low-latency delivery (sub-second for normal streams); best-effort (a dropped comment on a firehose is fine); scales from a tiny stream to hundreds of millions of concurrent viewers; highly available. |
The sentence that earns points: "Writes are rare and reads are everywhere, so I push comments out rather than letting millions of clients poll, I separate the read and write paths so they scale independently, and I accept that on a mega-stream the goal shifts from 'deliver every comment' to 'convey the vibe' — which changes the whole delivery strategy." Say that and you have framed the entire design before drawing a box.
Step 2 — Capacity estimation (back of the envelope)
Estimation here is about proving two things: the fan-out is enormous, and at the top end delivering every comment becomes meaningless.
| Quantity | Assumption | Result |
|---|---|---|
| Viewers / stream | thousands to hundreds of millions (mega-stream) | one comment fans out to that many screens → the fan-out is the system |
| Comments / sec | a few on a small stream, ~5,000 on a mega-stream | writes are light, but a hot stream's write rate is still a flood to display |
| Read:write | most viewers only read | heavily read-skewed → push, don't poll; scale reads separately |
| Mega-stream display | ~5,000/sec, ~20 shown on screen | each comment visible ~4ms → unreadable → real-time + completeness stop mattering |
Two conclusions fall out, and you should say both out loud. First, you push, not poll, and split read from write — millions of viewers polling would hammer the servers, so comments are pushed over a persistent connection, and because reads dwarf writes you run separate realtime messaging servers for delivery that scale independently of the lightweight write path. Second, the requirements change at the top — on a mega-stream, comments arrive faster than anyone can read, so low latency and delivering every comment stop being the goal; you switch to sampling and periodic snapshots, trading completeness and a second of latency for survivability. You have now pointed the interview at the fan-out and the mega-stream pivot — the real deep dives — before anyone asked.
Step 3 — API and data model
The interface separates a rare write (post a comment) from a constant read (the stream of comments).
| Call | Operation |
|---|---|
POST postComment(video_id, text) |
infrequent write: validate/moderate, persist, and publish to the video's comment channel |
subscribe(video_id) → stream
|
the viewer opens a one-way SSE stream from a messaging server for near-real-time comments |
getRecent(video_id) → comments[]
|
a mid-stream joiner (or reconnect) fetches the recent window to catch up |
The data model is tiny — comments are short and mostly ephemeral:
| Entity | Notes |
|---|---|
comment |
id, video_id, user, text, ts — short, and persisted so a late joiner or a brief disconnect can catch up. |
channel |
a pub/sub topic per group of videos (hash(video_id) % N), carrying that group's comments to the messaging servers. |
recent_window |
a small per-stream buffer (ring buffer) of the last N comments, for catch-up and for mega-stream snapshots. |
Step 4 — High-level design: real-time fan-out
Now the boxes. A live comments system is a lopsided fan-out — a thin write path feeding a fat push-based read path:
- Viewer → realtime messaging server (read path): each viewer holds a one-way SSE connection to a messaging server and tells it which video they are watching; the server pushes new comments down that connection.
- Post a comment → write service (write path): posting a comment is an ordinary HTTP POST to a lightweight write service that moderates/validates, persists the comment, and publishes it to the video's channel.
- Pub/sub between them: the write path publishes to a pub/sub channel keyed by the video; the messaging servers subscribe to the channels their connected viewers care about, and push matching comments out.
- Separate scaling: the read fleet (messaging servers holding millions of connections) scales independently of the write fleet (handling a trickle of posts) — because the traffic is wildly asymmetric.
- Mega-stream path: above a viewer/comment threshold, a stream flips to sampling + CDN snapshots — a periodic buffer of recent comments served from a CDN — instead of per-connection push.
Say explicitly that you push rather than poll and separate the read and write paths, because the traffic is lopsided and they must scale on their own curves; and that the pub/sub layer is what connects a rare write to a massive read fan-out. Naming the push model, the read/write split and pub/sub unprompted is a signal the interviewer is listening for.
Deep dive: real-time delivery — push, not poll
This is the first decision that actually decides the round, because polling is the instinct and it is wrong here. New comments must appear without the client guessing when to ask.
Push over poll. Polling makes millions of clients repeatedly ask "anything new?", which is wasteful and laggy; instead the server pushes a comment the moment it is created. The two push options are WebSockets (a full two-way channel) and Server-Sent Events (SSE) (a one-way server-to-client stream over HTTP). For balanced chat, WebSockets win — but live comments are lopsided: almost everyone only reads, and comment creation is rare, so opening and maintaining a two-way socket per viewer is overhead you do not need. SSE fits: viewers read a one-way stream efficiently, and the occasional comment goes up as a plain HTTP POST. Saying "SSE, because reads dwarf writes" is the senior tell.
Separate read from write. Because the read load (millions of streaming connections) and the write load (a trickle of posts) are so asymmetric, you run them as separate services: dedicated realtime messaging servers hold the connections and push, while a lightweight write service handles posts. That lets you scale the fat read fleet independently of the thin write fleet, and keeps a spike in viewers from affecting the write path.
"Your first instinct is to have each client poll every second — why is that wrong, and what do you do instead?" Polling millions of viewers wastes resources and adds lag; you push instead. And because viewers almost only read, you use one-way SSE rather than a two-way WebSocket, and run the read (messaging) fleet separately from the write fleet so they scale on their own curves. Name push-over-poll, SSE-for-read-heavy, and the read/write split.
Deep dive: fan-out coordination with viewer co-location
This is the decision most candidates get tangled in, because the naive pub/sub quietly wastes everything. The problem: a comment for video X must reach only the messaging servers that have viewers of X — without every server processing every comment.
Channels, not one-per-video. A channel per live video would be an unbounded number of channels, which systems like Kafka cannot handle well, so you hash videos into a fixed set of channels (hash(video_id) % N). Each messaging server subscribes only to the channels its connected viewers actually need — not to everything — so a comment flows only to the servers that care.
Co-locate viewers of the same video. There is still a trap: with round-robin load balancing, one server ends up with viewers scattered across many videos, forcing it to subscribe to many channels and re-creating the waste. The fix is intelligent routing — a Layer 7 load balancer using consistent hashing on the video id routes all viewers of the same stream to the same messaging server (or a small set), so each server subscribes to few channels and fan-out stays tight. For the pub/sub itself, Redis pub/sub is a common interview choice: low latency, it handles the dynamic subscription churn of viewers joining and leaving videos well, and its fire-and-forget nature is fine because comments are persisted anyway (a viewer who misses one during a blip catches up from the recent window). Kafka scales but struggles with that constant subscribe/unsubscribe pattern.
"A comment is posted on one video — how does it reach only the servers with that video's viewers, and not every server?" Hash videos into a bounded set of pub/sub channels and have each messaging server subscribe only to the channels its viewers need; then co-locate viewers of the same video on the same server with consistent-hash L7 routing, so each server subscribes to few channels. Redis pub/sub suits the dynamic subscriptions. Name the channel hashing, viewer co-location, and why Redis pub/sub fits.
System Design
HLD · Messaging & realtime · 45 min
Design a live video comments system out loud, with follow-ups
Deep dive: mega-streams — sampling and CDN snapshots
This is the decision that separates a strong answer from a staff-level one, because it recognises that the requirements themselves change at extreme scale. A typical stream is handled fine by the push-and-pub/sub design; a mega-stream is a different problem.
When real-time stops mattering. On a stream with hundreds of millions of viewers and thousands of comments a second, each comment would sit on screen for a few milliseconds before being shoved off — no human can read that. Users are not following a conversation; they are feeling a collective vibe. So the real-time goals — sub-second latency and delivering every comment — stop being worth their cost, and you deliberately relax them.
Sampling and CDN snapshots. Instead of pushing every comment to every one of a hundred million connections, you sample — select a representative subset to show — and you change the delivery mechanism: the server keeps a ring buffer of the last ~100–200 comments per mega-stream, and clients poll a snapshot of that buffer from a CDN every second or two, then animate the comments smoothly so it still feels live. A single cached snapshot served to millions is vastly cheaper than millions of individual pushes. You flip to this mode dynamically when a stream crosses a threshold (say 100k concurrent viewers or 500 comments/sec). Two nice touches: the client optimistically inserts the user's own comment immediately (so you always see yourself post, even if others see it a second later), and the 1–2 seconds of added latency is acceptable precisely because engagement is a vibe, not a chat. Naming that the requirements change — and reaching for sampling plus CDN snapshots — is the move the interviewer is waiting for.
"World-cup final, a hundred million viewers, five thousand comments a second — your push design melts. Now what?" You stop trying to deliver everything in real time, because no one can read it. Flip the mega-stream to sampling plus a CDN-served snapshot: keep a ring buffer of recent comments, let clients poll a cached snapshot every second or two and animate it, and insert the user's own comment locally. Name that the requirements change, sampling, and CDN snapshots.
System Design
HLD · Messaging & realtime · 45 min
Defend the fan-out and the mega-stream pivot out loud
The follow-ups that decide the live comments round
Scan the probes from each deep dive and they rhyme. Master these five and you are ready for a version of the question that is not drawn exactly like this one.
- "Clients poll every second — why is that wrong?" → It wastes resources and adds lag across millions of viewers; you push instead, over one-way SSE because reads dwarf writes. (problem solving)
- "How does a comment reach only the servers with that video's viewers?" → Hash videos into bounded pub/sub channels and co-locate same-video viewers on the same server with consistent-hash L7 routing, so each server subscribes to few channels. (technical execution)
- "Why SSE over WebSockets here?" → The traffic is lopsided — almost everyone only reads — so a one-way stream is cheaper than maintaining a two-way socket per viewer. (communication)
- "A mega-stream has 5,000 comments a second — your push design melts. Now what?" → The requirements change: sample a representative subset and serve a CDN snapshot of a recent-comments ring buffer that clients poll and animate. (problem solving)
- "A viewer reconnects after a blip — did they lose comments?" → No: comments are persisted and there is a recent-window catch-up, so pub/sub's fire-and-forget delivery is fine. (technical execution)
Each maps to a debrief dimension. Reading this list teaches you the answers; it does not teach you to deliver them while someone interrupts — that only comes from saying them out loud.
How to prepare: a one-week plan
You do not need fifty systems. You need this one cold and the framework automatic, so the next "design X" is just new nouns in the same five steps.
- Days 1–2: Learn the five-step framework until it is reflex. Do the live comments system end to end on paper — requirements, estimate, data model, the viewer → messaging server / post → write service → pub/sub fan-out.
- Days 3–4: Drill real-time delivery: push vs poll, SSE vs WebSockets and why the read/write imbalance picks SSE, and separating the read and write fleets. Say each tradeoff in one sentence.
- Days 5–6: Own fan-out and mega-streams — channel hashing, viewer co-location with consistent-hash routing, Redis pub/sub and catch-up, and the sampling/CDN-snapshot pivot at extreme scale. Answer each of the five follow-ups out loud.
- Day 7: A full timed 45-minute round, narrating the whole way, with someone (or something) interrupting. This is the rep that counts.
This post is the deep walkthrough behind one row of the broader Top 25 system design interview questions — once the real-time fan-out is automatic, the same spine carries the rest of the list.
Frequently asked questions
How do I design a live video comments system step by step?
Follow the five-step HLD framework. Clarify requirements (post a short comment, deliver new comments to everyone watching in near-real-time, catch up on join — read-heavy and write-light, best-effort, scaling from tiny to hundreds of millions of viewers); estimate to show the fan-out is enormous and that on a mega-stream delivering every comment becomes meaningless; define the postComment/subscribe/getRecent API and the tiny comment/channel/recent-window model; draw the lopsided fan-out (viewers on SSE to realtime messaging servers, a lightweight write service that persists and publishes, pub/sub between them); then deep-dive the three decisions that matter — push-based delivery with SSE and a read/write split, pub/sub fan-out with viewer co-location, and the mega-stream pivot to sampling and CDN snapshots.
Should a live comments system use WebSockets or Server-Sent Events?
Usually Server-Sent Events (SSE). WebSockets give a full two-way channel and are the right choice for balanced chat where both sides send frequently, but live comments are lopsided: almost every viewer only reads, and posting a comment is a rare event. Maintaining a two-way socket per viewer is overhead you do not need, whereas SSE provides an efficient one-way server-to-client stream over HTTP for the constant read traffic, and the occasional comment goes up as a plain HTTP POST. So the read/write imbalance is the reason to prefer SSE here, and you pair it with separate read (messaging) and write fleets so each scales on its own curve.
How does a posted comment reach only the right servers?
Through pub/sub with viewer co-location. You do not create a channel per video — that would be an unbounded number of channels — so you hash videos into a fixed set of channels (hash(video_id) % N), and each realtime messaging server subscribes only to the channels its connected viewers need. The trap is that round-robin load balancing scatters a video's viewers across many servers, forcing each to subscribe to many channels; the fix is intelligent routing, where a Layer 7 load balancer uses consistent hashing on the video id to send all viewers of the same stream to the same server, so each server subscribes to only a few channels. Redis pub/sub is a common choice because it is low latency and handles the dynamic subscription churn of viewers joining and leaving, and its fire-and-forget delivery is fine because comments are persisted for catch-up.
What happens on a mega-stream with millions of viewers and thousands of comments a second?
The requirements change, and so does the design. At thousands of comments a second each comment would be on screen for only a few milliseconds, so no one can read them and users are experiencing a collective vibe rather than following a conversation — which means low latency and delivering every comment are no longer worth their cost. So above a threshold (say 100,000 concurrent viewers or 500 comments a second) you flip the stream from per-connection push to sampling plus CDN snapshots: the server keeps a ring buffer of the last 100–200 comments, clients poll a cached snapshot of it from a CDN every second or two and animate the comments smoothly, and the client optimistically shows the user's own comment immediately. A single cached snapshot served to millions is dramatically cheaper than millions of individual pushes, and the extra second of latency is acceptable because engagement at that scale is a vibe, not a chat.
How is this different from designing WhatsApp or Slack?
The fan-out shape and the durability needs are different. WhatsApp and Slack deliver every message reliably to a bounded set of recipients (a chat or a channel's members), with threads, read receipts and durable history, and a roughly balanced read/write pattern that suits WebSockets. Live video comments broadcast to an unbounded, massive audience watching one stream, are overwhelmingly read-heavy, are mostly ephemeral and best-effort, and — uniquely — change their own goals at extreme scale, dropping real-time completeness in favour of sampling once a stream is too big to read. So a live comments design centres on efficient one-way fan-out, viewer co-location and the mega-stream pivot, rather than reliable per-recipient delivery and rich conversation features.
How do I practise a system design interview out loud?
Reading a walkthrough is not the same as defending a design while someone interrupts. On Zynter, the HLD track runs live voice rounds modelled on how real system design loops run — you talk through a shared design on the canvas, and a voice interviewer pushes with the follow-ups above one at a time, then gives you a debrief on problem solving, communication, technical execution, and time management. The score is a practice signal, not a hiring decision.
Practise it on Zynter
You can say "broadcast the comments." The round is won on push-not-poll, co-location and the mega-stream pivot.
Pick the Live Video Comments round, draw the real-time fan-out on the canvas, and defend it out loud to a voice interviewer that keeps asking "why not just poll?" and "what happens when a hundred million people watch at once?" — then read the debrief. Zynter.ai is on-demand mock interviews modelled on real company loops, with 150+ rounds across 20 companies including the HLD system design track (Sep 2026).
Practise the Live Comments round →
Browse all interview tracks




Top comments (0)