Phase 1 — Clarify & Scope
Interviewer: Design Twitch — a live video streaming platform. What do you want to clarify?
Candidate: Key questions:
- Both live streaming (broadcast) and VOD (replay past streams)?
- What's the scale — concurrent streamers and viewers?
- What's the key latency requirement — broadcast delay from streamer to viewer?
- Chat and interactive features (polls, subscriptions, donations)?
- Adaptive bitrate streaming — do we transcode to multiple quality levels?
Interviewer: Both live and VOD. 8 million concurrent viewers, 100,000 concurrent streamers. Target latency: < 6 seconds (standard) with a low-latency mode < 3 seconds. Include chat. Yes to adaptive bitrate — transcode to 360p, 480p, 720p, 1080p. Focus on the video pipeline.
Candidate: Let me size this:
The delivery-to-ingest ratio is 32 Tbps / 600 Gbps ≈ 53× — CDN is essential; we cannot serve all viewers from origin.
Interviewer: What are the core requirements?
Candidate:
- Accept RTMP stream from streamers, transcode to multiple quality levels (HLS/DASH adaptive)
- Distribute video to millions of concurrent viewers with < 6 second latency
- Low-latency mode: < 3 second end-to-end delay
- Live chat: messages visible to all viewers within 2 seconds
- VOD: past streams stored and searchable
- Stream health monitoring: alert streamer if their upload quality degrades
Non-functional:
- 99.99%…
In the full tutorial
- Phase 2 — High-Level Architecture
- Phase 3 — Deep Dive & Evolution
- Phase 4 — Robustness & Operations