Dev Skills

Design a video platform like YouTube / Netflix

Design a service where people upload videos and other people watch them. Uploads come from phones on unreliable networks. Playback should start quickly and adapt to the viewer's connection.

About this problem

“Design a video platform like YouTube / Netflix” is a hard-level problem in the big files family. The payload is far bigger than the metadata, and it should not go through your servers at all.

The key challenge: Uploading and processing have hours of slack. Starting playback has almost none. Designing both paths the same way is the usual way to fail this problem.

Time budgets: Processing: minutes. Playback start: under 2 seconds. Upload: hours if needed.

The worked solution for Video platform goes through why those budgets shape the design, stage by stage.

Before you start

You will work this in five timed stages. Here is what each one asks you to think about. None of it is the answer; the answers unlock in the workspace below once you have written your own.

  1. Stage 1 · Requirements · 5 min
    • What is the first thing to say about where the bytes travel?
    • Is playback public or access-controlled? That changes caching completely.
    • Live or on-demand? Do not assume silently.
  2. Stage 2 · Actors and lifecycle · 6 min
    • Phones on trains lose connections. What does that do to a 500 MB upload?
    • Transcoding takes minutes and can fail. Then what?
    • What does the uploader see between upload and watchable?
  3. Stage 3 · Numbers · 6 min
    • Storage is cheap and easy to estimate. Do not stop there.
    • What does transcoding multiply your storage by?
    • Compare the cost of storing a video with the cost of serving it.
  4. Stage 4 · High-level design · 12 min
    • Where do the bytes go on upload? Not through your servers, hopefully.
    • What is a "segment" and why does it exist?
    • How does the player decide which quality to fetch?
  5. Stage 5 · Deep dive and tradeoffs · 14 min
    • The numbers pointed at egress. What drives the cache hit rate?
    • A video goes viral in one country. What happens?
    • How do you make a phone on a train succeed at a 500 MB upload?
Prefer to read first? The worked solution, end to end →

Work it through

Five stages, gated. You write your answer for each stage before its model answer unlocks. That is the core of the method.

Loading your progress…

Done all five? The diagrams, numbers, trade-offs and follow-ups for this problem are on the worked solution page, to check your own design against.

Before you leave
Try this problem again in a week without reading anything. Comparing what you write then with what you wrote today shows you what stuck.
Stuck, or new to this?Read the full worked solutionAll five stages end to end, with the diagrams and the costs, written out the way you would say it. Best read after you have had a go.Read it →

How it is really built

Write your own answer first. Then read how teams who run this at scale describe it. Their constraints were real, and the write-ups often say what their choices cost.