Design a Video Streaming Platform

HardMediaCDNTranscodingBlob StorageAdaptive StreamingAbout 45 minutes

Design a video platform like YouTube. Creators upload videos, which are processed for playback on any device, and viewers stream them with minimal buffering. Plan for 500 hours of video uploaded per minute and 1B views per day worldwide.

How the interview goes

Five phases, and questions the interviewer is likely to ask in each.

  1. 1. Requirements

    • How soon after upload must a video be playable?
    • Which devices and network conditions must playback handle?
    Show a hint

    Estimate egress first: it dwarfs every other cost here.

  2. 2. High-level design

    • Where are the video files stored, and who reads them?
    • What is synchronous and what is asynchronous here?
    Show a hint

    Keep large bytes away from your application servers.

  3. 3. Deep dive

    • How do you make transcoding of a 3-hour video fast and restartable?
    • How does the player switch quality mid-stream?
    Show a hint

    Video can be cut into short segments that are processed and served independently.

  4. 4. Scaling

    • How do you keep CDN costs under control for the long tail of rarely watched videos?
    • How do view counts stay accurate under heavy load?
    Show a hint

    Popular and unpopular videos deserve different storage and caching strategies.

  5. 5. Trade-offs

    • Transcode every rendition up front, or on demand?
    • What would you change for live streaming?
    Show a hint

    Consider which renditions are worth precomputing for a video with ten views.

Practice this with an AI interviewer

Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.

Start this interview