The whole course ▾

System Design · Mock interview 15 of 20

Design live video streaming for 50 million viewers

Updated 22 Oct 2026 · By Akshay, software engineer, India · 9 min read

Design live video streaming for fifty million viewers.

Try it first

Before you read the interview, answer the question yourself. Give yourself 10 minutes: say your design out loud, or sketch it on paper. What would you ask? Which numbers matter? Which boxes, and what's the hard part? Then read on, and score yourself with the feedback at the end.

The video for this mock interview is coming soon.

New System Design videos go up at 6 pm. Subscribe on YouTube so you don't miss it.

Got a doubt? Ask in the comments under the video.Subscribe

Requirements

Requirements
Clarifying questions
->
Live only? -> Yes, one huge event
->
Scale? -> 50M watching at once
->
Delay? -> Under 10 s behind the stadium
->
Devices? -> Phones to TVs, 240p to 4K
Functional requirements
Take in the broadcaster's feed
Turn it into many qualities, live
Deliver it to every viewer
Rewind a few minutes
Non-functional requirements
->
50 million concurrent viewers
->
Stadium to screen: 5 to 10 seconds
->
Smooth: buffering is rare
->
No single point of failure
Out of scope
Live comments
Adverts inside the stream
Payments and subscriptions
interviewer
Hi. Big one today. Ready?
candidate
Ready. I'll sketch as I go.
interviewer
Design live video streaming for a sports final. Say a cricket World Cup final, with fifty million people watching at once.
candidate
Okay. Two things stand out already: it's live, so there's no time to prepare files in advance, and everyone wants the same bytes in the same few seconds. Let me ask a few questions.
interviewer
Go ahead.
candidate
Is it live only, or recorded videos too?
interviewer
Live. One huge event.
candidate
What scale?
interviewer
Fifty million people at the same time.
candidate
How much delay is acceptable between the stadium and the screen?
interviewer
Under about ten seconds, and lower is better. Nobody wants to hear the neighbours cheer before they see the six.
candidate
And which devices?
interviewer
Everything from a cheap phone on mobile data to a 4K television.
candidate
So, what it does. Take in the broadcaster's feed from the stadium. Turn it into many qualities, live, as it arrives. Deliver it to every viewer, on every kind of device and network. And let viewers rewind a few minutes, to watch that wicket again.
candidate
And how well. Fifty million concurrent viewers. Stadium to screen in five to ten seconds. Buffering should be rare, because a spinning wheel in the last over is what people remember. And no single point of failure anywhere on the path.
interviewer
Right. There's no second chance with a final.
candidate
I'll leave out live comments, adverts inside the stream, and payments and subscriptions. Does that match what you had in mind?
interviewer
Yes. Delivery at this scale is what I care about.

Estimation

Estimation
Back of the envelope
50M viewers × ~3 Mbps ~ 150 Tbps
2-second segments, in ~6 qualities
50M ÷ 2 s ~ 25M segment requests/s
But only ~6 new segments every 2 s
WHAT THE NUMBERS DECIDE
Millionsofrequestsforahandful
ofnewfiles:thewholedesignis
aboutfanningoutbytesthrough
caches,andprotectingtheorigin.
candidate
Let me do the numbers. I suspect one of them decides almost everything.
interviewer
How much bandwidth does this need?
candidate
Viewers, times bitrate.
candidate
Fifty million viewers at about three megabits a second each is roughly a hundred and fifty terabits a second of bandwidth, far more than any one company's servers could send. The video is cut into two-second segments, in about six qualities. Each viewer fetches a new segment every two seconds, so about twenty-five million segment requests a second. And yet, every two seconds, there are only about six new files in the whole system.
interviewer
A hundred and fifty terabits. Is that even possible?
candidate
Only by spreading it across several CDNs, each with servers in hundreds of cities.
candidate
So twenty-five million requests a second, all for the same handful of new files. This is a fan-out problem: get each new segment from one place to fifty million screens through layers of caches, while the origin, where segments are born, sees only a trickle.
interviewer
That's the key insight.

API and data

API and data
Live event
ingest points,
qualities
Playlists
latest segments,
per quality
Segments
2 s files, origin
storage
per quality
lists
What players fetch
1
GET /live/final/master.m3u8:
qualities
2
GET /live/final/720p.m3u8:
latest segments
3
GET /live/final/720p/48213.ts:
one segment
4
Refresh the playlist every ~2
seconds
candidate
Live video has very little API. Most of the contract is files.
interviewer
What do players actually request?
candidate
Two kinds of file, refreshed constantly.
candidate
First, a master playlist, listing every quality. Then the playlist for one quality, which lists the latest few segments, and changes every two seconds as new ones appear. Then each segment itself: two seconds of video, a plain file. The player refreshes its playlist every couple of seconds, fetches each new segment, and switches quality as its network changes.
candidate
The data is small. The live event: where the feed comes in, and which qualities to make. Playlists: for each quality, the latest few segments, rewritten every two seconds. And segments: two-second files, written once and never changed, kept for the rewind window, and later for the recording.
interviewer
Why does never changed matter?
candidate
Files that never change can be cached anywhere, without ever going stale.

High-level design

High-level design
Broadcaster
feed
from the
stadium
Ingest
servers
two regions
Live
transcoders
6 qualities
Packager
segments +
playlists
Origin
one feed,
twice
1
2
6 qualities
3
segment
48213
4
Origin
shield
mid-tier
cache
CDN
edges
thousands,
several
CDNs
50M
viewers
one fetch
each
5
one fetch total
6
playlist,
segments
The fan-out tree
Origin: ~6 new segments every 2 s
Shields: a few fetches each
Edges: thousands, one fetch each
Viewers: 25M requests a second
TWO RISKS
Delayunderten
seconds,without
buffering.Andthepeak,
andfailures,mid-match.
interviewer
Okay. Show me the pipeline.
interviewer
Walk me through it, from the stadium to a phone.
candidate
The production side first, where segments are made.
candidate
The broadcaster feed arrives from the stadium, sent twice, to ingest servers in two regions, so losing one changes nothing. Live transcoders turn it into six qualities, from 240p to 4K, in real time. A packager cuts each quality into two-second segments, and updates the playlists. Every segment and every playlist is written to the origin.
interviewer
How is that different from YouTube?
candidate
YouTube can transcode from a queue. Here, a queue means falling behind the match.
candidate
Now the fan-out. Fifty million viewers fetch from thousands of CDN edges, spread across several CDN companies. The edges don't go to the origin directly. They ask an origin shield, a mid-tier cache, which fetches each new segment from the origin once. So a segment travels origin to shield once, shield to each edge once, and each edge to thousands of nearby viewers.
interviewer
Why several CDN companies, not one?
candidate
No single CDN wants all of it, and if one has a bad night, the others carry on.
candidate
Look at the load at each level. The origin serves about six new segments every two seconds, to a handful of shields. The shields serve thousands of edges, one fetch per segment each. And only at the edge does it become twenty-five million requests a second, from viewers, spread across hundreds of cities. Each layer multiplies, so no layer melts.
interviewer
Nice.
interviewer
What would worry you on the night?
candidate
Two things. Getting the delay under ten seconds without making playback fragile. And the peak, when everyone joins for the last over, or when a piece of this chain fails mid-match.
interviewer
Delay first.

Deep dive: delay versus smoothness

Deep dive: delay versus smoothness
Long segments, big buffer
6–10 s segments, 3 buffered
30+ seconds behind live
Very smooth
Short segments, small parts
2 s segments, sent in parts
About 5 seconds behind live
Smooth enough with good CDNs
THE CHOICE
2-secondsegments,sentin
partsasthey'remade:about
5secondsbehind,withthe
playerchoosingquality.
interviewer
Let's take the trade-off.
interviewer
How do you get the delay down without causing buffering?
candidate
Every second of delay is a second of safety buffer, so it's a real trade-off. Let me compare two settings.
candidate
Long segments, six to ten seconds each, with three buffered, are very smooth, but leave viewers thirty seconds or more behind the stadium. Short segments, two seconds each, sent in small parts while they're being made, bring the delay down to about five seconds. With good CDNs, that's smooth enough.
interviewer
What if one segment arrives late?
candidate
The player has a few seconds of buffer, so one late segment is invisible. Several in a row, and it drops the quality.
candidate
So, short segments with low-latency delivery, and keep the safety elsewhere. The player still buffers a few seconds, and drops quality quickly when the network weakens. And every player aims for a fixed distance behind live, so two phones in one room show the six at nearly the same moment.
interviewer
I like that last detail.
interviewer
Why not sub-second delay, like a video call?
candidate
Things like WebRTC send a separate stream to each viewer. Perfect for a call of ten people, enormously expensive for fifty million. Segments let the CDNs fan out ordinary files. For one-to-millions, a few seconds of delay is the price of scale.
interviewer
A viewer pauses, then rewinds three minutes to watch a catch again. Where does that video come from?
candidate
The live playlist can list the last few minutes of segments, not just the newest. Those segments are still in the CDN and the origin, so rewinding is just fetching older files. When they catch up, the player jumps back to live.
interviewer
How far back can they go?
candidate
As far as we keep segments in the playlist, say thirty minutes. Beyond that, it's the recording.

Deep dive: peaks and failures

Deep dive: peaks and failures
Surviving the peak
1
Reserve capacity across several CDNs
2
Collapse requests at every cache layer
3
Cache playlists for about a second
4
If short: lower the default quality
High-level design
Broadcaster
feed
from the
stadium
Ingest
servers
two regions
Live
transcoders
6 qualities
Packager
segments +
playlists
Origin
one feed,
twice
1
2
6 qualities
3
segment
48213
4
Origin
shield
mid-tier
cache
CDN
edges
thousands,
several
CDNs
50M
viewers
one fetch
each
5
one fetch total
6
playlist,
segments
1 fetch per new segment
two regions: either can
carry it
The fan-out tree
Origin: ~6 new segments every 2 s
Shields: a few fetches each
Edges: thousands, one fetch each
Viewers: 25M requests a second
TWO RISKS
Delayunderten
seconds,without
buffering.Andthepeak,
andfailures,mid-match.
interviewer
Now, the last over.
interviewer
The last over arrives, and twenty million more people join within five minutes. What happens?
candidate
If the plan was made weeks before, it holds.
candidate
Reserve capacity with several CDN companies weeks in advance, and spread viewers between them. At every cache layer, collapse requests: when a thousand viewers ask an edge for a segment it doesn't have yet, it fetches once and answers all thousand. Cache playlists for about a second, since they change every two. And if capacity runs short, lower the default quality: a softer picture beats a frozen one.
candidate
So each shield and edge collapses identical requests, and the origin's load is the same whether five million or fifty million are watching. And the production path exists twice, in two regions: two ingest paths, two sets of transcoders, two packagers. Players and CDNs can switch to the other path in seconds if one fails.
interviewer
A transcoder crashes in the middle of the match. What do viewers see?
candidate
Ideally, nothing. Transcoders run in pairs, both making the same qualities from the same feed, with segments numbered by their time in the broadcast, so either one's segment is interchangeable. The packager takes segments from whichever is healthy. At worst, a player skips a fraction of a second.
interviewer
One CDN starts failing in one city. How do you notice, and react?
candidate
Players report their experience every few seconds: start time, buffering and errors. When one CDN's numbers worsen in one city, a steering service sends new and reconnecting viewers there to another CDN, within a minute or so. I'd watch the viewers' experience, not just our servers.
interviewer
Good.

Wrap-up

Wrap-up
Next steps
1
Adverts stitched into segments
2
Recording for watching later
3
Watch join time, buffering, delay
4
Rehearse with test traffic before finals
INTERVIEWER'S FEEDBACK
Strong:onefile,millionsofreaders,a
redundantlivepipeline,shortsegments,
collapsingcaches.Nexttime:howalate
viewerstartsfast.Verdict:stronghire.
interviewer
We're nearly out of time.
interviewer
What would you improve with more time?
candidate
A few things.
candidate
First, adverts stitched into the stream on the server, as their own segments, so every device plays them the same way. Second, the recording: the segments already exist, so the full match is ready to watch later almost at once. Third, I'd watch the time to start playing, the share of time spent buffering, and the delay behind live. And fourth, rehearse with test traffic before every final, because there's no second take.
interviewer
Which would you do first?
candidate
The rehearsal. Everything else can be fixed later. The final can't.
interviewer
Okay, let's stop there. Excellent. You saw straight away that it's a handful of files for fifty million readers, and built a fan-out tree of caches around it. The live pipeline exists twice, short segments bring the delay down, and every cache collapses requests. One thing to add: how a viewer joining mid-match starts playing within a second or two. I'd say a strong hire.
candidate
Thanks. Starting from the newest segment, at a low quality, would do it.
Interviewer's feedback

Strong: one file, millions of readers, a redundant live pipeline, short segments, collapsing caches. Next time: how a late viewer starts fast. Verdict: strong hire.

Score yourself

Interviewers score these seven things. Give your own attempt a tick for each one you did.

  • Asks before drawing. Agrees what the system does, and how well: scale, speed, consistency.
  • Turns users into requests a second and bytes a day, and says what the numbers decide.
  • A small, clear contract, and a data model that fits how the data is read.
  • A working path end to end before any detail. Every box has a reason.
  • Picks the hard parts, compares two options, and chooses one with a trade-off said out loud.
  • What breaks, what happens then, and how users notice. Retries, duplicates, limits.
  • Thinks out loud, checks in with the interviewer, and takes a hint without losing the thread.

0 of 7

Your progress stays on this device.
New System Design videos at 6 pm

Lessons on weekdays, the week's revision on Saturday, a mock interview on Sunday.