Let creators upload videos and viewers watch them across variable network connections.
Separate upload processing from playback, and reason about encoding, cacheability, and access control.
01. Separate the control and media paths
The control plane manages video metadata, ownership, publication state, and access. The media path stores and serves large objects. A viewer first obtains an authorized playback description, then retrieves media segments through an appropriate delivery network.
Start with uploaded files rather than live streaming. Upload completion, processing completion, and publication are different states. A creator should see whether a video is still processing instead of receiving a broken playback link.
02. Build an idempotent processing pipeline
Store the uploaded source under an immutable ID, verify completion and checksums, and create jobs for transcoding into chosen resolutions and bitrates. Package outputs with a manifest and publish only after required outputs pass validation. Failed jobs retry with stable execution identities.
Write outputs to a versioned location and switch a metadata pointer when ready. A retry must not leave a manifest referring to partially written segments. Keep the source according to the retention policy so you can re-encode when formats or quality targets change.
03. Estimate bandwidth and encoding trade-offs
A two-hour video at a constant 5 megabits per second contains about 4.5 GB of encoded media in decimal units, excluding audio and packaging overhead if the bitrate describes video only. Several renditions require additional storage; adaptive playback usually downloads one chosen rendition at a time.
The player chooses segments based on available bandwidth and buffer state. Shorter segments can improve adaptation but increase request and packaging overhead. Measure startup delay, rebuffering, playback failures, and delivered quality rather than treating maximum resolution as the sole objective.
04. Cache safely and revoke explicitly
Immutable segment URLs are easy to cache. Private media still needs an authorization design such as short-lived signed access and a clear cache policy. Revocation is bounded by token lifetime and any relevant cache behavior; deleting a database row does not instantly erase previously delivered bytes.
Follow-up: a new popular video causes a cache-miss surge. Preposition selected renditions, limit origin concurrency, and monitor origin capacity. Regional failures can fall back to another origin or rendition if the player and access design support it. Playback analytics should not block media delivery.
Practice the follow-up
Trace an interrupted transcode retry and explain how a viewer is prevented from seeing incomplete output.
Connect this to file storage.
Sources & further reading
RFC 8216: HTTP Live Streaming; RFC 9111: HTTP caching. The interview scenario, calculations, and proposed design choices are illustrative.
Continue your preparation
Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.