System Design/general/Design YouTube: scalable video upload & streaming

Design YouTube: scalable video upload & streaming

HARD30 minDistributed SystemsContent DeliveryScalabilityStorageCachingLoad BalancingLow LatencyVideoStreamingCDNTranscodingSystem Design

Design a scalable YouTube-like service supporting large resumable uploads, adaptive streaming, and low-latency playback at internet scale.

Design a scalable YouTube-like service supporting large resumable uploads, adaptive streaming, and low-latency playback at internet scale. Use this guide to structure the discussion, test the design under pressure, and practise explaining trade-offs clearly.

Problem and Scope

Design a video streaming platform similar to YouTube that allows users to upload and watch videos.

Start by confirming the core user journey, exclusions, success criteria, and the constraints that materially affect the architecture.

Requirements to Clarify

A strong answer should establish scope before choosing components.

Functional requirements:

  • Users should be able to upload videos
  • Users should be able to watch videos
  • Videos should be processed and encoded after upload
  • Users should be able to access videos with minimal latency
  • Users should be able to watch videos without needing to download the entire file first

Non-functional requirements:

  • High reliability for video storage
  • Availability prioritized over consistency
  • Low latency video playback
  • System should be able to handle billions of video views daily
  • System should be able to process millions of video uploads daily

Scale and Capacity

Use the workload to justify storage, partitioning, caching, and reliability decisions. Clarify or challenge these assumptions rather than treating them as unquestionable facts:

  • 1 billion daily active users
  • 5 billion videos watched per day
  • 50 million new videos uploaded per day
  • Ratio of 100:1 for video views vs uploads
  • Potentially thousands of concurrent viewers for popular videos

Architecture Discussion

Walk through the important read and write paths, identify ownership boundaries, and explain how the design behaves when dependencies fail. Cover these areas explicitly:

  • Load balancing system for request distribution
  • Video upload and processing service
  • Video storage solution (object storage)
  • Video encoding service
  • CDN for optimized content delivery
  • Caching layer for frequently accessed content
  • Metadata database for video information
  • Streaming mechanism that supports chunked video delivery
  • Handling the massive scale of video uploads and views
  • Ensuring reliable storage of video content
  • Optimizing video playback to minimize latency and buffering
  • Managing the encoding process for various video formats and qualities
  • Efficiently distributing video content globally
  • Balancing availability vs consistency in a read-heavy system

Follow-up Questions

Expect the interviewer to test the consequences of your choices. Practise answering these questions with a concrete decision, its benefit, and its cost:

  • How would you handle video encoding given the scale requirements?
    • Focus: Assess the candidate's answer to "How would you handle video encoding given the scale requirements" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • What considerations would you have for the video streaming protocol?
    • Focus: Assess the candidate's answer to "What considerations would you have for the video streaming protocol" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • How would your system ensure that videos are delivered with minimal latency?
    • Focus: Assess the candidate's answer to "How would your system ensure that videos are delivered with minimal latency" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • What trade-offs did you consider when choosing between different storage solutions?
    • Focus: Assess the candidate's answer to "What trade-offs did you consider when choosing between different storage solutions" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • How would your system handle a temporary service disruption during video upload?
    • Focus: Assess the candidate's answer to "How would your system handle a temporary service disruption during video upload" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • What methods would you employ to distribute videos globally?
    • Focus: Assess the candidate's answer to "What methods would you employ to distribute videos globally" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.

Evaluation Rubric

MockMe evaluates the answer across the following dimensions. A complete answer should connect claims to requirements and explain consequential trade-offs.

  • Requirements and scope (15%): Clarifies and prioritizes the required behavior for Users should be able to upload videos; Users should be able to watch videos; Videos should be processed and encoded after upload. Establishes the constraints that materially affect Design YouTube: scalable video upload & streaming, including High reliability for video storage; Availability prioritized over consistency. Strong evidence includes Separates the critical path from secondary features and resolves ambiguous requirements before choosing components.
  • Architecture and interfaces (20%): Presents coherent ownership boundaries and end-to-end flows covering Load balancing system for request distribution; Video upload and processing service; Video storage solution (object storage); Video encoding service. Strong evidence includes Defines interfaces and traces important success, retry, and failure paths across the proposed components.
  • Data and scaling (25%): Uses workload assumptions such as 1 billion daily active users; 5 billion videos watched per day to justify capacity and partitioning decisions. Explains the data, state, or model strategy for Video storage solution (object storage); Metadata database for video information; Streaming mechanism that supports chunked video delivery. Strong evidence includes Quantifies a dominant workload, identifies the first bottleneck, and explains how the design evolves as that workload grows.
  • Reliability, correctness, and safety (20%): Explains concrete failure behavior, recovery, and operational safeguards for Ensuring reliable storage of video content; Balancing availability vs consistency in a read-heavy system; High reliability for video storage. Strong evidence includes States the required correctness or consistency boundary and covers retries, partial failure, observability, and safe degradation.
  • Communication and trade-offs (20%): Drives a structured discussion and compares consequential alternatives for Managing the encoding process for various video formats and qualities; Efficiently distributing video content globally; Balancing availability vs consistency in a read-heavy system. Strong evidence includes Makes assumptions explicit, answers the question asked, and explains both the benefit and cost of major decisions.

Ready to practice this question?

Run a mock system design interview with AI coaching and detailed feedback.