Video streaming system design
Design a video platform for our school.
The problem
A video site where teachers upload lesson videos and students watch them.
A video is cut into short pieces. The player fetches them one after another while the student watches.
Questions to ask the interviewer
How many people watch, and how much?
About 2,000 watch requests a second: each one is a 6-second piece of video.
How do lessons get in?
Teachers upload about 1 a minute, each about 2 GB and 30 minutes long.
Must a lesson be ready at once?
Not yet: a lesson may be ready later the same day.
What about bad connections?
For now, everyone has a good network.
What is the budget?
About $200 a month.
Want to try it yourself first? Play, then come back for the approach.
PlayThe design in short
A video platform has two flows that look nothing alike. Watching is many small requests: the player fetches one short piece after another, all day. Uploading is few, huge files: a lesson of about 2 GB that must be turned into those pieces before anyone can watch it.
Watching is about distance and bytes. Each request is a few seconds of video, so the bytes add up fast. Multiply watch requests a second by the size of one piece, and you know how much data leaves your system every second. Then ask which part sends those bytes, how far they travel, and what each byte costs you.
Uploading is about not blocking. A 2 GB file takes a long time to arrive. If it passes through your app servers, they are busy the whole time. Then the video must be cut and encoded, which is slow, heavy work. The brief says a lesson may be ready later the same day, so nobody waits for that step. Think about where that work runs and how it gets its turn.
Items for your sketch:
- the app tier for everything that is not video bytes
- where the video files and their pieces are stored
- the workers that prepare each upload
The main trade-off is cost against speed. Every way of sending the pieces has a price and a delay. Compare them with the numbers in the brief, not with a guess. Copies of popular pieces cost money too, so say what they save before you add them.
Two numbers carry the scale: the bytes a second from watching, and minutes of lesson uploaded each minute. They grow different parts, so check each one on its own, with room to spare.
Ask the interviewer about the students, too: where they are, and what network they have today. The game lets you wire up both flows and see which part gives first.
Last updated 22 October 2026