hard netflix google · part of Practice Questions · Senior SWE Roadmap
Requirements to clarify
- Functional: upload video, process/encode it, stream to viewers on varying devices/network speeds, support seeking.
- Non-functional: massive read (view) volume vs comparatively low write (upload) volume, global audience needs low-latency delivery, storage cost at scale is significant.
Core components
- Upload & encoding pipeline: raw upload → transcode into multiple resolutions/bitrates and chunk into short segments (this is what enables adaptive streaming) — typically an async pipeline via a message queue, since encoding is slow.
- Storage: encoded chunks stored in an object storage system (see Design an S3-like Object Storage System), metadata (title, owner, available qualities) in a separate DB.
- CDN: video chunks are cached at edge locations close to viewers — this is the single biggest lever for both latency and origin server load (see CDN & Content Delivery).
- Adaptive bitrate streaming (ABR): the client player monitors its network speed and switches between pre-encoded quality levels chunk by chunk (e.g., via HLS/DASH manifests).
Key tradeoffs
- Encoding many resolutions upfront costs storage and compute but makes playback fast and adaptive; encoding on-demand saves storage but adds latency on first view.