Question presented to candidate: "Design YouTube. Creators upload videos of any length, viewers all over the world watch them on phones, laptops and TVs with fast start and no buffering, and every video shows a view count. Assume hundreds of hours of video uploaded every minute."
What a strong answer should cover:
- Capacity: upload hours per day, encoded storage for a full bitrate ladder, transcoding compute, and viewer egress in Tbps, which shows delivery bandwidth is the dominant cost
- The upload path: resumable chunked upload to object storage, then a transcoding pipeline that splits the video into chunks and encodes them in parallel into a bitrate ladder (resolutions and bitrates), packaged as HLS/DASH segments with manifests
- Delivery through a CDN of immutable segment files, and adaptive bitrate on the player: choosing the rendition per segment from measured throughput and buffer level, with the trade-off between quality, stalls and switching
- Metadata, search and recommendations as separate services; view counting as an event stream aggregated asynchronously with abuse filtering
- What breaks at 10x: storage for rarely watched videos, encode cost, CDN egress, popular-video hot spots at the edge
Clarifying questions expected:
- Video on demand only, or live streaming too?
- Which devices and maximum resolution? Is there a target start time and rebuffer rate?
- How quickly must a video be watchable after upload?
Code / implementation expected: Optional โ the capacity arithmetic and a player simulation comparing fixed, throughput-based and buffer-based bitrate choice on one bandwidth trace; the example does both.