KatInterview

Build a Global Video Platform with Resumable Upload and ABR Streaming

System DesignModel answer
HardModel answerSystem Designvideo-streamingdistributed-systemscdn

Last updated

Architect a scalable video platform supporting chunked uploads, distributed transcoding into adaptive bitrate formats, moderation workflows, and CDN-backed delivery.

Problem

You're building the backend for a video platform that allows users to upload large video files, processes them into multiple quality levels, and streams them efficiently to a global audience.

Functional Goals

  1. Chunked Upload Flow: Users upload videos up to 10 GB in size. The system must support pause, resume, and automatic retry on connection drops without restarting from zero.

  2. Multi-Quality Encoding: Every uploaded video is transcoded into adaptive bitrate formats (HLS or DASH) at 360p, 480p, 720p, and 1080p. The pipeline must handle retries gracefully—if a worker crashes mid-encode, no duplicate or corrupted output should be produced.

  3. Content Review Gates: Before a video becomes public, it passes through automated moderation (frame analysis, audio transcription, copyright fingerprinting). The review step should not delay encoding itself.

  4. Adaptive Playback: Clients receive video segments that match their current bandwidth. Segment delivery should start within 1.5 seconds globally.

  5. Access Rules: Videos can be public, unlisted, or private. Private videos require time-limited signed tokens for playback.

Scale Targets

  • 50,000 uploads daily (~100 TB of raw video per day)
  • 10 million daily viewers streaming 50 million hours total
  • 99.99% availability for playback; 99.9% for upload
  • 11-nines durability for all video files

What You Should Address

  1. Upload mechanism: How clients send large files reliably, how state is tracked, and how the system resumes interrupted transfers.
  2. Transcoding orchestration: How the work is split, distributed to workers, and protected against duplicate execution.
  3. Data schema: Tables or collections for videos, jobs, chunks, moderation results, and access policies.
  4. Delivery architecture: How manifests and video segments are cached at the edge, how access control integrates with CDN signed URLs, and cache invalidation strategy.
  5. Moderation flow: Where it fits in the state machine and how it gates publication without blocking encoding.

Hints

Hint 1

Separate the upload data plane from the control plane—clients should write bytes directly to object storage using pre-signed URLs.

Hint 2

Make transcoding deterministic by using content-addressed output keys; a retried task will produce the same filename and can skip work if the file already exists.

Hint 3

Run moderation and transcoding in parallel branches, then join the results before marking the video as published.