ProblemWeb apps and media
Video streaming
Upload a video once and play it smoothly on any device and connection, for a worldwide audience.
The brief
Video platform · suggested for Senior
Design a video streaming platform
Design a video platform: creators upload videos, the platform prepares them for playback, and tens of millions of people watch them on phones, TVs and browsers, anywhere in the world, at whatever quality their connection allows.
Creators upload videos from a few seconds to many hours long, often from phones on patchy mobile connections, and want to know when each one is ready to watch. Viewers press play on a phone, a TV or a laptop, on anything from fast home broadband to a crowded train, and expect the picture to start almost at once and keep going. The platform is global and very read-heavy: people watch far more video than is uploaded, and a new video from a popular creator can draw millions of viewers in its first hour. Owners see how often each video is watched and can delete a video or make it private, and the trust and safety team can take a video down; a removed video must stop playing everywhere, quickly. Search and recommendations are run by other teams, from data this platform provides. Design the platform, from the moment a creator starts an upload to the moment a viewer's video starts playing.
Functional requirements
- CoreCreators upload a video file of up to 256 GB, with a title and description, from a phone or a browser.
- CoreCreators see whether each upload is still being processed, is ready to watch, or has failed.
- CoreAnyone can watch a ready video on a phone, TV or browser, and jump to any point in it.
- CoreOwners see how many times each of their videos has been watched.
- CoreOwners can delete a video or make it private, and trust and safety can take a video down.
- CoreSearch and recommendations, run by other teams, get the data they need about new videos and what people watch.
Non-functional requirements
- LatencyPlayback starts within about 2 seconds, rarely stalls, and the picture quality follows each viewer's connection as it changes.
- AvailabilityPlayback stays available (99.99%), even while a whole region is down.
- QualityA dropped connection never sends a creator back to the start of an upload.
- DurabilityOnce an upload is confirmed, the original file is never lost.
- LatencyMost videos are ready to watch within minutes of the upload finishing, and a creator can always see where their video is.
- ConsistencyA deleted, private or taken-down video stops playing everywhere within about 5 minutes.
- ConsistencyView counts may lag by a few minutes.
- CostStoring and sending video are the biggest costs; keep them in check as the library and the audience grow.
Scale
- ScaleAbout 500 hours of video uploaded every minute; files from a few megabytes to 256 GB.
- ScaleAbout 1 billion hours watched every day; about 60 million people watching at once at the busiest time.
- ScaleA new video from a very popular creator can draw millions of viewers in its first hour.
- ScaleViewers and creators all over the world; the platform runs in several regions.
Nice to mention (below the line)
- Below the lineThumbnails and captions.
- Below the lineComments, likes and subscriptions.
- Below the lineSaved lists of videos and watch history.
Out of scope
- Out of scopeLive streaming: every video is uploaded first, then watched.
- Out of scopeHow search and recommendations rank videos.
- Out of scopeCopyright matching, DRM and copy protection.
- Out of scopeDeciding which plays count as real views (filtering bots).
- Out of scopeSign-up, channels, ads and payments to creators.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- Video platformSuggested for Senior
Creators upload long videos from their phones; tens of millions of people watch at once, on any device and connection, anywhere in the world.
9 steps · 7 must-pass · about 50 min at Senior
What each level is graded on
Video platform, step by step. A result at a level needs its must-pass steps answered, and only the steps you answer count. Going up a level adds steps or holds them to a stricter bar.
| Step | Entry level | Mid-level | Your levelSenior | Staff |
|---|---|---|---|---|
| The numbers that shape the design (optional) | Graded | Graded | Graded | Graded |
| Video records and video files | Graded | Graded | Graded | Graded |
| Uploading a big file, and starting to watch | Graded | Must-pass | Must-pass | Must-pass |
| Upload and play, end to end | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| Smooth playback on any connection | Must-pass | Must-pass | Must-pass | Must-pass |
| From upload to ready to watch | Must-pass | Must-pass | Must-pass | Must-pass |
| Views, search and recommendations | — | Must-pass | Must-pass | Must-pass |
| Removing a video everywhere | — | Must-pass | Must-pass | Must-pass |
| A few huge hits and a long tail | — | — | Must-pass | Must-pass |
| A region goes down | — | — | — | Must-pass |
| At this level | 6 steps 3 must-pass about 33 min | 8 steps 6 must-pass about 43 min | 9 steps 7 must-pass about 50 min | 10 steps 8 must-pass about 56 min |
Entry level6 steps · 3 must-pass · about 33 min
- The numbers that shape the design (optional)Graded
- Video records and video filesGraded
- Uploading a big file, and starting to watchGraded
- Upload and play, end to endMust-passcan block
- Smooth playback on any connectionMust-pass
- From upload to ready to watchMust-pass
Mid-level8 steps · 6 must-pass · about 43 min
- The numbers that shape the design (optional)Graded
- Video records and video filesGraded
- Uploading a big file, and starting to watchMust-pass
- Upload and play, end to endMust-passcan block
- Smooth playback on any connectionMust-pass
- From upload to ready to watchMust-pass
- Views, search and recommendationsMust-pass
- Removing a video everywhereMust-pass
SeniorYour level9 steps · 7 must-pass · about 50 min
- The numbers that shape the design (optional)Graded
- Video records and video filesGraded
- Uploading a big file, and starting to watchMust-pass
- Upload and play, end to endMust-passcan block
- Smooth playback on any connectionMust-pass
- From upload to ready to watchMust-pass
- Views, search and recommendationsMust-pass
- Removing a video everywhereMust-pass
- A few huge hits and a long tailMust-pass
Staff10 steps · 8 must-pass · about 56 min
- The numbers that shape the design (optional)Graded
- Video records and video filesGraded
- Uploading a big file, and starting to watchMust-pass
- Upload and play, end to endMust-passcan block
- Smooth playback on any connectionMust-pass
- From upload to ready to watchMust-pass
- Views, search and recommendationsMust-pass
- Removing a video everywhereMust-pass
- A few huge hits and a long tailMust-pass
- A region goes downMust-pass
- Must-pass
- a result at that level needs this step answered.
- Can block
- a miss there is a Blocking issue at that level.
Going up a level
- Mid-level
- “Uploading a big file, and starting to watch” becomes must-pass.“Smooth playback on any connection” is graded more strictly.Adds “Views, search and recommendations”, must-pass.Adds “Removing a video everywhere”, must-pass.
- Senior
- “From upload to ready to watch” is graded more strictly.Adds “A few huge hits and a long tail”, must-pass.
- Staff
- “A few huge hits and a long tail” is graded more strictly.Adds “A region goes down”, must-pass.
Skills this problem practises
Your coach tracks readiness per skill across every problem you practise. Each links to the lesson that teaches it.
- Capacity estimation
- API design
- Idempotency and retries
- Data modelling
- Choosing storage
- High-level architecture
- Queues and async messaging
- Networking and protocols
- Caching
- Replication and durability
- Observability and operations
Worked solution
Try it first: practise a variant, then read the walkthrough and compare it with your own design. Reading it first makes the practice much less useful.
Learn: Design YouTubeYour history
Sign in to see your sessions on this problem.