Design a Video Storage and Streaming Platform
Design video upload, processing, storage, search, download, and adaptive playback at scale.
Problem statement
For this exercise, assume that a creator uploads a video, the platform processes several playback qualities, and a viewer searches for and watches or downloads the authorized asset. Accept resumable video uploads through bounded, authorized object-store transfers and durably record completion.
Validate, transcode, package, and publish multiple playback qualities with immutable manifests. Serve adaptive playback and authorized downloads through a CDN without bypassing visibility policy. Index published video metadata and return fresh, permission-filtered search results.
Assume the stated workload, latency, and failure targets. Preserve this invariant: every published manifest references only complete immutable renditions derived from one accepted source version, and authorization is checked before playback or download.
Keep unrelated social, recommendation, monetization, and company-specific infrastructure outside the first version.
Also explain hot-topic search. For this exercise, creators choose metadata topic tags from a public vocabulary. A hot topic ranks those tags by successful playback-start events over the previous 24 hours, without personalization.
Each start has a stable event ID and an immutable server admission time; transport retries must not count it again or move it into a newer window. Only currently public, published videos contribute to the global popularity projection.
Hide or delete changes remove their retained contribution within the one-minute projection target. Topic labels themselves are public vocabulary; returned video items must always pass current publication and visibility checks even while ranking is stale.
A selected topic filters the existing video search rather than introducing a separate recommendation feed.
Explain a large-video cache strategy and how you choose its unit: time-based segments, byte chunks or a justified range design. Compare segment duration or chunk size against startup, seeking, overfetch, request overhead and cache behavior. No particular branded streaming protocol or numeric duration is mandatory.
Justify transport choices separately for control operations, processing status and CDN media delivery; naming REST or WebSocket alone is not sufficient.
What to build
- Accept resumable video uploads through bounded, authorized object-store transfers and durably record completion.
- Validate, transcode, package, and publish multiple playback qualities with immutable manifests.
- Serve adaptive playback and authorized downloads through a CDN without bypassing visibility policy.
- Index published video metadata and return fresh, permission-filtered search results. Support non-personalized hot-topic discovery and topic-filtered results with visible ranking freshness and current item authorization.
At scale
- For this exercise, assume 50 million daily viewers, 100,000 concurrent uploads, and two million playback starts per second at peak.
- For this exercise, begin playback within two seconds at p95 and publish searchable metadata within one minute of a successful processing workflow.
- For this exercise, an upload may be several hundred gigabytes, processing may retry, and a region or CDN origin may fail without losing acknowledged source bytes.
- For this exercise, refresh the rolling24-hour public-topic popularity projection within one minute. View-event retries retain their original event ID and server admission time; popularity lag never permits returning a currently forbidden video.