Skip to content
We areTOP 1%

Design a video streaming service like YouTube

HardConceptMedia & Commerce
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Requirements: upload videos, play them smoothly on any device and network, and support search, view counts and comments at a very high read-to-write ratio.

  • Upload and processing: raw files go to object storage; a queue-driven transcoding pipeline converts each video into several resolutions and codecs and splits it into segments a few seconds long.
  • Playback: clients use adaptive bitrate streaming (HLS or DASH), fetching a manifest and switching quality segment by segment as bandwidth changes.
  • Delivery: segments are served from a CDN; metadata such as titles, owners and view counts lives in a database with caching.
  • Trade-off: storing many renditions and serving everything from the CDN is expensive, so popular videos are cached at the edge while rarely watched ones may be served from origin or kept in fewer formats.

More in Media & Commerce

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account