← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 035 · Scalability and reliability

Design a Video-on-Demand Platform

Medium 55 min

Design a video platform where creators upload recorded videos and viewers watch them on phones, laptops and TVs. Creators upload 50,000 videos a day, up to 4 GB each. At peak, 2 million people watch at once; players fetch a few-second video segment roughly every 4 seconds and switch quality as their bandwidth changes. Playback must start quickly and rarely stall, and a new upload should be watchable within 15 minutes.

Functional requirements

  • Upload large video files with resumable uploads
  • Transcode each upload into several resolutions and bitrates
  • Stream video with adaptive bitrate so quality follows the viewer's bandwidth
  • Browse video pages with title, description, thumbnail and view count
  • Resume playback where the viewer stopped

Non-functional requirements

  • Playback starts within 2 seconds at p95
  • Fewer than 1% of sessions stall for rebuffering
  • A new upload is playable within 15 minutes
  • Uploaded originals are never lost

Constraints and scale

  • 2 million concurrent viewers at peak, about 500,000 segment requests per second
  • 50,000 uploads a day, average 600 MB, up to 4 GB
  • Each video is stored in 5 renditions, roughly 3x the size of the original

You will practise

  • Serve segmented video from a CDN with adaptive bitrate streaming (HLS or DASH)
  • Run transcoding as a parallel, retryable background pipeline
  • Keep the metadata API small and fast, separate from the heavy video bytes
Show 3 hints
  1. Half a million segment requests per second should not reach your servers. Who serves them instead?
  2. A 2-hour video takes a long time to transcode on one machine. Can it be split into chunks?
  3. Most views go to a small fraction of videos; how does that help your caching and storage costs?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • A transcoding backlog builds upA spot-instance reclaim removes 60% of the transcoding fleet during a busy afternoon. The job queue grows to 8,000 videos and creators complain that uploads have been 'processing' for over an hour.

Run them from the workspace once your design is in place.