40. Design Video Upload and Streaming (YouTube)
1
The interview prompt2
40.1 What do you ask first?3
40.2 How big is this, really?4
40.3 What are the doors?5
40.4 What do we store?6
40.5 What does the whole system look like?7
40.6 How does the upload pipeline work?8
40.7 How does transcoding work?9
40.8 How does adaptive bitrate work?10
40.9 How does CDN delivery work at this scale?11
40.10 How do you count views?12
40.11 What would you say in the last five minutes?13
Score yourself14
Variations to practise15
Sources16
Code lab40. Design Video Upload and Streaming (YouTube)
Variations to practise
3 min read+10 XP
Chapters used
Approach (1), Estimation (2), Blob storage (11), Caching and hot keys (13), Message queues (22), APIs (24), CDNs and video segments (26), Failures (29), Leaderboards and audited counts (35).
Try these variations
Each is a common follow-up. Answer in two minutes, then check the sketch.
- "Short vertical videos (like Reels)." → Smaller files, aggressive prefetching of the next few videos, and lower start-up latency targets.
- "Paid movies with DRM." → Encrypt segments; licence servers issue keys to authorised players; the CDN still caches the encrypted segments.
- "Let creators replace a video." → New video ID or a new version of the renditions with new URLs; old cached segments simply expire.
- "Cut costs by half." → AV1/VP9 for popular videos (smaller files, less egress), fewer qualities for rarely watched ones, cold storage for old originals.