Scope
Functional
- Upload video; process into streamable formats; watch with seeking; resume where you left off.
- View counts; recommendations and search are out of scope (briefly mentioned).
Non-functional
- Start playback in < 2 s; rebuffering < 0.5% of watch time.
- Uploads of up to several GB, resumable. Processing completes in minutes for typical videos.
- 200M daily viewers.
Size
- Uploads: 500k videos/day, average 10 minutes.
- Each source ~1 GB; output ladder ~2× source → ~1.5 PB/day of new storage.
- Watching: 200M viewers × 60 min/day at an average 3 Mbps → peak egress in the hundreds of Tbps. Only CDNs (including ISP-embedded caches) can serve this.
Upload and processing
- Chunk-parallel transcoding: split the source at keyframes into short chunks and transcode each chunk × each rendition in parallel on a large worker pool (a DAG managed by a workflow engine). A 1-hour video finishes in minutes instead of hours.
- Encoding ladder: e.g. 240p to 4K at several bitrates, H.264 for compatibility plus AV1/HEVC for efficiency. Netflix-style per-title encoding picks the ladder per video based on its complexity (cartoons need fewer bits than sports).
- Packaging: segments (2–6 s) plus a manifest (
.m3u8for HLS,.mpdfor DASH). DRM encryption for premium content.
Playback
The player owns adaptation: it measures throughput and buffer level and chooses the next segment's quality. The server just serves files, which is why video scales like static content.
The 30-second summary
"Uploads are resumable to object storage. A workflow splits the video into chunks, transcodes chunk × rendition in parallel, and packages HLS/DASH segments with manifests. Playback is adaptive bitrate: the player picks segment quality while the CDN serves immutable segments, with pre-positioning for popular titles. Progress and views flow through Kafka into last-write-wins stores and aggregators."
Follow-up questions the interviewer may ask
- How do you speed up transcoding for long videos?
- How do you decide which renditions to produce?
- How do you protect premium content?
- How do you resume playback across devices?
Model answers to each of these are in the book.