Design live comments for a live video stream
PremiumReal-timeMedium
- High fan in
- Fan out
- Comment sampling
Quick answer
This real-time interview question asks you to design live comments for a live video stream. Aim for a design that delivers updates to many users with low delay, then explain connections, fan-out, ordering and trade-offs. Interviewers want to see how you keep latency low, handle reconnects and stay correct under load.
The problem
Design live comments for a live video stream, like Facebook Live or YouTube Live. On a big stream, 3 million viewers watch and up to 20,000 comments arrive every second; every viewer should see a lively, readable flow close to real time, and their own comment at once.
Nobody expects to see every comment on a stream with 10,000 comments per second, but the stream must never look dead and must not show spam or removed comments. The hard part is the extreme fan-in on one hot stream and the fan-out back to millions of screens.
What must the system do?
- Post: A logged-in viewer posts a text comment on a stream; it shows on their screen at once.
- Read: Every viewer sees a flow of recent comments from other viewers, newest at the bottom, updated at least every second.
How well must it do it?
- Latency: A comment from another viewer appears within 2 seconds of posting (for sampled comments).
- Readability: A viewer never receives more than 10 comments per second regardless of volume.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- High fan in
- Fan out
- Comment sampling
- Rate limiting
- Hot partition
- Moderation pipeline
How you’ll practise
- Requirements
- Estimate
- Connections
- Message flow
- Delivery guarantees
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any real-time design round.
- Clarifies latency, ordering and delivery guarantees
- Chooses a connection model with reasons
- Explains fan-out to many receivers
- Handles reconnects, missed messages and duplicates
- Plans for hot spots and sudden traffic spikes
- States trade-offs between consistency and speed
Questions people ask about this interview question
- Which design type is this question?
- It is a real-time question. You design live comments for a live video stream and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with who sends and receives updates, how fast they must arrive and what order matters. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team