KatInterview

Design a Video Streaming Service with ABR and Cross-Device Resume

System DesignModel answer
HardModel answerSystem Designstreamingvideocdn

Last updated

Design a large-scale video platform supporting catalog browsing, adaptive-bitrate playback across devices, cross-device resume, and content ingestion.

You are tasked with designing a video streaming service at scale. Users should be able to browse a catalog of content organized by genre and editorial collections (such as "Newly Available" or "Trending Now"), search for titles, stream videos with quality adaptation based on network conditions across web browsers, mobile apps, and connected TVs, and pick up playback from where they stopped on any device. Content creators and studios need to upload video files that are then processed into streamable formats.

Scale and constraints:

  • Approximately 50 million daily active users, with peaks of around 5 million concurrent viewers
  • Global deployment across multiple regions
  • Source video files ranging from 1 to 10 GB
  • Target low startup latency (under 2 seconds at p95), minimal rebuffering, high availability, and content protection

Required capabilities:

  • Catalog browsing by genre and curated collections
  • Full-text search across titles and metadata
  • Adaptive-bitrate streaming that adjusts quality based on available bandwidth
  • Cross-session and cross-device playback resume
  • Video upload and automated processing pipeline
  • Authentication, authorization, and concurrent stream limits per account

What to cover:

  1. Requirements clarification and scale estimation — Distinguish functional from non-functional requirements, define what you would defer for an initial release serving ~100k users, and calculate bandwidth, request volume, and storage needs.

  2. Service boundaries and architecture — Identify the major subsystems (ingestion, catalog, search, playback control, session management, CDN) and how they interact.

  3. Data modeling — Schema for content metadata, video assets and quality variants, user accounts and profiles, playback sessions, and watch history.

  4. API design — Endpoints for browsing, searching, initiating playback, tracking progress, and uploading content.

  5. Video processing pipeline — How uploaded files are validated, transcoded into multiple quality levels, packaged for streaming, protected, and made available.

  6. Adaptive streaming mechanics — How quality variants are created, packaged, and delivered; how clients select the appropriate bitrate.

  7. Playback session lifecycle — Session initiation, periodic progress updates, concurrency enforcement, and durable resume state.

  8. Content discovery features — How "Newly Available" and "Trending Now" collections are computed and served.

  9. CDN strategy and caching — Origin versus edge responsibilities, cache policies, and cold-start handling.

  10. Scalability, consistency, and fault tolerance — Partitioning strategies, multi-region deployment, consistency guarantees for different data types, and graceful degradation.

  11. Observability and cost control — Key metrics, experimentation approach, and techniques to manage bandwidth and compute costs.

Be explicit about trade-offs and implementation priorities.

Hints

Hint 1

Separate the data plane (video bytes via CDN) from the control plane (metadata, session management) and size them independently—egress dominates the former, QPS the latter.

Hint 2

For an MVP with 100k users, defer personalized recommendations, multi-region active-active, and advanced search; focus on browse, play, and resume with a single CDN and tokenized URLs.

Hint 3

Use CMAF with common encryption to produce one segment set that works for both HLS and DASH, reducing storage by half and simplifying the pipeline.