Asked at
URL Shortener (TinyURL)
Asked from Junior level upFoundations & Storage
Distributed Rate Limiter
Asked from Mid level upAPI Gateway & Security
Distributed Key-Value Store
Asked from Senior level upFoundations & Storage
Distributed Notification Service
Asked from Mid level upMessaging & Queues
Distributed Web Crawler
Asked from Mid level upDistributed Systems
Metrics & Monitoring Platform
Asked from Senior level upObservability & Time-Series
Real-Time Chat App (like WhatsApp or Slack)
Asked from Mid level upReal-Time & WebSockets
Social News Feed (like X/Twitter)
Asked from Mid level upSocial & Feed Systems
Ride-Hailing App (like Uber)
Asked from Senior level upGeospatial & Real-Time
Low-Latency Stock Exchange Matching Engine
Asked from Staff level upFintech & Low Latency
Global Video Streaming Platform (like YouTube or Netflix)
Asked from Senior level upMedia & Streaming
Distributed Hotel & Ticket Reservation System
Asked from Mid level upE-Commerce & Transactions
Shared Document Editor (like Google Docs)
Asked from Staff level upReal-Time & Distributed State
Game Leaderboard
Asked from Junior level upCaching & Data Structures
File Sync Service (Dropbox / Google Drive)
Asked from Mid level upStorage
Payment System
Asked from Senior level upPayments & Transactions
Ad Click Aggregation
Asked from Senior level upStream Processing
AI Support Assistant (RAG)
Asked from Senior level upAI Systems
LLM Inference Platform
Asked from Senior level upAI Systems
Enterprise Semantic Search
Asked from Mid level upAI Systems
AI Code Completion
Asked from Senior level upAI Systems
LLM Gateway
Asked from Senior level upAI Systems
AI Agent That Takes Actions
Asked from Senior level upAI Systems
LLM Evaluation Platform
Asked from Senior level upAI Systems
AI Document Processing Pipeline
Asked from Mid level upAI Systems

Design a Global Video Streaming Platform (like YouTube or Netflix)

Asked from Senior level upDomain: Media & Streaming
Design it: check it against goals
Concepts to know first:

Design a video site for the whole world. It takes large uploads and turns each video into many sizes in parallel steps. Playback adjusts quality to the viewer (HLS or DASH).

An analogy

Think of YouTube like a video printing press. You upload one raw master film, and it gets sliced and converted into 10 different resolutions, such as 4K, 1080p, 480p, and 240p. That way, phones on slow 3G can still play it smoothly.

Where this design ends up. This is version 3 of 3. Part 5 builds it up from version 1 and says why each part was added.
  1. Clients
    • Uploader
    • Viewer
  2. Entry
    • CDN edge
  3. Services
    • Video service
    • Transcoding workers
    • Key service
  4. Queues, caches
    • Transcode queue
  5. Data, outside
    • Object storage

1. Requirements and scope

Functional Requirements
  • Upload video files up to 10GB.
  • Stream video with adaptive bitrate (4K, 1080p, 720p, 360p).
  • Search and view video metadata, likes, comments.
Non-Functional Requirements & SLAs
  • Low buffer latency (<2s initial play delay).
  • Zero video corruption.
  • Global edge delivery with 99.999% availability.
Key Traffic Assumptions: 500 Million daily video views, 500,000 hours of video uploaded daily.

2. Back-of-the-envelope numbers

Writes and reads each second
  • Writes: 35 uploads a second (1%)
  • Reads: 5,800 new views a second (99%)

Read-heavy: about 166 reads for each write. A cache and extra read copies help most here.

Write Throughput
~35 uploads/sec (500K hours/day at ~10 min each ≈ 3M videos/day)
Read Throughput
~5,800 new views/sec (500M views/day ÷ 86,400s); a few million streams play at once
Storage Growth
3M uploads/day × ~300MB average ≈ 900 TB/day (~330 PB/year before extra transcoded renditions)
RAM Cache Footprint
Top 20% videos cached on regional CDN edge nodes

3. API

POST/api/v1/videos/upload-urlGenerate S3 presigned multipart upload URL
GET/api/v1/videos/{videoId}/master.m3u8Fetch HLS adaptive bitrate playlist manifest

4. Data model and storage

Storage Strategy: S3 / Blob for video chunks + Cassandra for user views + PostgreSQL for video metadata.
VIDEOS Table: (id, uploader_id, title, duration, hls_manifest_url, status, created_at)

5. The design, in three versions

Version 1: Direct File Upload to Monolith

Browser uploads whole MP4 to web server; server saves to disk.

Global Video Streaming Platform (like YouTube or Netflix): Version 1: Direct File Upload to Monolith Version 1 of 3

The picture follows one request through the parts of this version, in order. Under it, switch a part off to see what the request does without it.

One request, step by step

Each numbered arrow is one step. Press "Simulate Request Flow" to follow them one at a time.

UploaderVideo serviceLocal disk123
  • The order of the steps
  • A request or its reply

The parts: switch one off

1. Clients

Uploadersends a video

2. Services

Video serviceaccepts uploads

3. Data, outside

Local diskfiles on the web server

The steps in words0 of 3 steps shown

  1. Uploader to Video serviceHTTPS · 3 ms

    The whole file is uploaded to the web server.

  2. Video service to Local diskquery · 8 ms

    The server saves it on its own disk.

  3. Video service to Uploaderreply · 20 ms

    The uploader gets "done".

Why this version
Fastest MVP.
Next bottleneck
Connection drops restart 10GB uploads. Server disks fill up fast. No adaptive streaming.

Write path, read path and failures

Each path follows one request through the final design (version 3), one hop at a time.

Write pathUpload a video

  1. Client
  2. Upload API
  3. Object storage
  4. Queue
  5. Transcoding workers
  6. Metadata database
  1. Client to Upload API

    The app asks to upload. The API returns a signed URL that allows a direct upload to storage.

  2. Client to Object storage

    The app splits the file into 5 MB parts and uploads them in parallel. A failed part is sent again alone.

  3. Object storage to Queue

    When the last part arrives, storage sends an "upload complete" message to a queue.

  4. Queue to Transcoding workers

    Workers cut the video into 5-second clips. They encode each clip at several qualities, such as 360p and 1080p, in parallel.

  5. Transcoding workers to Object storage

    They save the clips and a playlist file that lists every quality.

  6. Transcoding workers to Metadata database

    The video is marked ready, and viewers can now find it.

Read pathWatch a video

  1. Client
  2. Metadata API
  3. CDN edge
  4. Object storage
  1. Client to Metadata API

    The player asks for the video's details and the URL of its playlist.

  2. Client to CDN edge

    It downloads the playlist from a nearby edge server. Then it asks for the first clips at a quality that fits its network speed.

  3. CDN edge to Object storage

    If the edge does not have a clip, it fetches it from storage once and keeps a copy.

  4. CDN edge to Client

    The player measures each download. It moves to a lower quality when the network slows, and back up when it recovers.

What breaks, and what happens then

  • A transcoding worker crashes in the middle of a clip

    What users see
    That clip is not finished.
    What the design does
    The clip's message returns to the queue after a time limit, and another worker encodes it. Only that 5-second clip is redone.
  • An upload breaks at 90%

    What users see
    Without parts, the user would have to start again.
    What the design does
    The app asks which parts arrived and sends only the missing ones.
  • A video goes viral

    What users see
    Millions of players ask for the same clips.
    What the design does
    Edge servers hold those clips, so storage is read about once per edge location.
  • A CDN location fails

    What users see
    Players near it see errors.
    What the design does
    DNS or network routing sends them to the next nearest location, and the player retries the clip.

6. Deep dives

HLS vs MPEG-DASH Adaptive Bitrate
Video is split into 2-10 second chunks encoded at multiple resolutions (360p, 720p, 1080p, 4K). A master .m3u8 playlist lists all qualities. The client video player monitors packet download speed and seamlessly switches to lower or higher bitrate chunks without pausing playback.
S3 Multipart Presigned Upload Pipeline
Uploading directly through application servers wastes bandwidth and blocks threads. The client requests a presigned URL with an upload ID, then splits the file into 5MB chunks. It uploads the chunks concurrently with retry to S3, and notifies the backend when done.

7. Follow-up questions

  • How do you spot the same video uploaded twice? (Answer: compare a checksum of each block, or a hash of what the first frames look like.)

What it costs

Storage and delivery dominate: about 900 TB of new video a day, and the CDN bill grows with every view. Encode rarely watched videos in fewer sizes, and move old ones to a cheaper storage class.

Another way to design it

A smaller site can encode each video in one pass on one worker, with no split into clips. It is simpler and slower. Splitting matters when long uploads must be ready in minutes.

8. How answers are judged

A passing answer at Mid level. A complete design with numbers: about 35 uploads a second and millions of streams playing at once. It explains chunked upload and transcoding into several resolutions, and goes deep on one part.

How each level is judged
What is judgedJuniorMidSeniorStaff
BreadthHow much of the system does the answer cover?Names the core parts: clients, servers, a database and a cache.Covers the whole main flow, from the request to the stored data and back.Builds a complete design without being led through it.Covers the system, the systems around it and who owns each part.
DepthHow far does it go into the hard parts?Explains what each part does and why it is there.Goes deep on one part, such as the database or the cache.Goes deep on the two or three riskiest parts.Goes deepest where the risk is largest, and explains why the risk is there.
DrivingWho leads the conversation?Follows the interviewer, step by step.Moves forward alone, with an occasional nudge.Leads the conversation from start to finish.Changes the problem when the question asked is not the right one.
Trade-offsAre choices compared and justified?Names more than one option.Says why one option was picked over another.Compares options in detail, with what each one costs.Ties each choice to cost, speed and risk for the business.
Unclear questionsWhat happens when the question is vague?Answers the questions that are asked.Asks questions to make the problem clear.Sets the scope and says what is left out.Questions the assumptions behind the problem itself.
ScopeWhat does it consider beyond the normal path?Covers the normal path, when everything works.Adds what happens when a part fails.Adds growth: what breaks at ten times the load, and the fix.Adds abuse, cost and the daily work of running the system.

Requirements and scope

Strong answer
Before I design, I want to check the scope. This is on-demand video: upload, transcode and stream, not live broadcasting. Should the original master file be kept after transcoding, in case we need a new resolution later, or deleted to save storage? I will assume it is kept for now.
Weak answer
Once a video is transcoded into every resolution we support, I would delete the original upload right away. Keeping it forever wastes storage space for no real benefit.

Shows: Unclear questionsThe difference: Deleting the original assumes future needs are known today. Without it, adding a new resolution later means asking users to re-upload instead of re-transcoding.

Estimates

Strong answer
500,000 hours uploaded a day, at about 10 minutes a video, is close to 3 million uploads a day, about 35 a second. At 300 MB per raw upload, that is about 900 TB a day, before the extra resolutions transcoding adds on top.
Weak answer
Three million uploads a day at about 300 MB each is about 900 TB a day. That is what I would provision object storage for and call it sized.

Shows: DepthThe difference: The weak answer sizes storage for the original upload alone. Transcoding into several resolutions adds more storage on top of that raw total.

Core design

Strong answer
The client uploads in chunks to a presigned URL so a dropped connection resumes instead of restarting. Once the upload finishes, a queue kicks off transcoding workers that build each resolution asynchronously. The video goes live once the first rendition is ready.
Weak answer
When the upload finishes, the server transcodes the video into every resolution right there in the same request. It only replies success once all of them are ready.

Shows: DepthThe difference: Transcoding a large video inline can take minutes, so the uploader waits that long. The strong answer transcodes asynchronously after the upload completes.

Deep dive

Strong answer
The hard part is serving video worldwide without buffering. The player measures its own download speed and switches between rendition chunks, from 4K down to 360p, without restarting playback. A CDN edge near the viewer caches the popular renditions, so most requests never reach the origin.
Weak answer
I would pick one good resolution, say 1080p, and stream that same rendition to every viewer, no matter their connection.

Shows: DepthThe difference: A single fixed resolution buffers on a slow connection and wastes bandwidth on a fast one. Adaptive bitrate switches renditions to match each viewer's connection.

Failures and trade-offs

Strong answer
If a video suddenly goes viral, its CDN cache entries can expire at the same moment, sending many viewers' requests to the origin server together. I would combine those into one origin fetch per rendition, and give popular videos a longer edge cache lifetime so this happens less often.
Weak answer
If a video goes viral, the CDN keeps serving copies from its edge cache. The origin server never sees any extra load from it.

Shows: ScopeThe difference: Cache entries can still expire at the same moment for a hot video, sending a burst of requests to origin together. The strong answer combines those instead.

We wrote this guide in our own words, informed by public interview guides such as AlgoMaster and Hello Interview. We are not connected to either site. Interviewers differ. The guide and the example answers show the direction each level takes, not a checklist.

10. Check your design with your own AI

Write your design first. Then copy this prompt into the AI chat you already use, and add your design at the end. It asks for a score in each area, one fix for each, and two follow-up questions.

The site sends nothing anywhere. An AI review can be wrong, so check what it says against sections 8 and 9.

See the prompt
You are a system design interviewer. Review my design for the interview problem below.

Problem: Design a Global Video Streaming Platform (like YouTube or Netflix)
Design a video site for the whole world. It takes large uploads and turns each video into many sizes in parallel steps. Playback adjusts quality to the viewer (HLS or DASH).

What users must be able to do:
- Upload video files up to 10GB.
- Stream video with adaptive bitrate (4K, 1080p, 720p, 360p).
- Search and view video metadata, likes, comments.

How well it must work:
- Low buffer latency (<2s initial play delay).
- Zero video corruption.
- Global edge delivery with 99.999% availability.

Numbers to assume:
- 500 Million daily video views, 500,000 hours of video uploaded daily.

Judge my design at the Mid level.
A passing answer at this level: A complete design with numbers: about 35 uploads a second and millions of streams playing at once. It explains chunked upload and transcoding into several resolutions, and goes deep on one part.

For each area below, say whether my design is strong, fine or weak. Give one reason and one fix for each:
1. Requirements and scope
2. Estimates
3. Core design
4. Deep dive
5. Failures and trade-offs

Then ask me the two follow-up questions an interviewer would ask next.
Do not write a full model answer for me.

My design:
[Describe your parts, how one request moves through them, and why you chose each one.]