Question 7 · Track 2 · Store it and serve it
Design a video streaming service
Nobody streams a video file. They stream a manifest.
Store it and serve it. 4 clarifying questions to ask first, the answer in 4 moves, the follow-up that catches a memorised answer and 2 supporting topics to watch or read.
Short answer live
What it is really testing
Whether you know where the work happens — upload-time, not request-time — and who chooses the quality.
Ask these first
Before a single box goes on the board. The answers change the design, which is the point of asking out loud.
- How many concurrent viewers at peak?
- Live, on-demand, or both?
- Which devices and networks do we have to support?
- How soon after upload must a video be watchable?
The answer, in 4 moves
In this order. Each move earns the next one — say them out loud rather than drawing all four and narrating afterwards.
- 1Transcode once, on upload, into a bitrate ladder.
- 2Cut each rendition into immutable segments and push them to a CDN.
- 3The CLIENT picks the bitrate at the next segment boundary, from a manifest.
- 4Keep metadata in a database, apart from the blobs it describes.
The trap
The follow-up that separates a rehearsed answer from a real one.
Adaptive bitrate is a client decision. The server publishes a manifest and immutable segments and then does nothing clever — which is exactly why it survives a spike.
Watch or read
The pieces of this answer, each covered on its own. Take them whichever way suits you, then give the whole answer without looking.
Cache vs CDN
Cache and CDN both store copies for faster reads, but solve different problems: cache cuts backend work for dynamic data; CDN cuts network distance for static content. Learn when to use each.
S3 vs database blobs
Should raw image and video bytes live inside your database or in object storage like S3? Stuffing files into a bytea/BLOB column keeps everything in one place and works for a weekend project — then backups drag terabytes through your most expensive tier and reads pull huge binaries through the connection pool. Here's why object storage plus a tiny DB reference plus short-lived pre-signed URLs is how the big apps actually store media — and how the same pattern serves model weights and generated media for LLM apps.
Part of System Design Interviews, Answered Out Loud. The fundamentals underneath it are the free CS course.