Lesson 13 of 16
40. Design Video Upload and Streaming (YouTube)

Score yourself

3 min read+10 XP

Score yourself

Give yourself 0, 1 or 2 points per row.

Area0 points1 point2 points
RequirementsStarted drawingUpload and watchProcessing time, smooth playback, devices, skew and view counts agreed
EstimatesNoneNumbers, not used laterEgress, transcoding and storage numbers drove CDN, autoscaling and tiers
API and dataSkippedUpload endpoint onlyResumable upload, status, playlist URL, view events; originals vs renditions
High-level designStream the originalUpload + storagePipeline, CDN watch path and counting walked
Deep diveHand-wavedOne topicParallel transcoding, ABR, CDN at scale or view counting done properly
Trade-offsNone namedNamed when askedRaised unprompted (ladder size vs cost, segment length, exact vs live counts)
CommunicationLong silencesMostly clearThought out loud, checked in, managed time

12 to 14: strong hire signal. 8 to 11: solid, polish the weak rows. Under 8: redo the round in a week, timer on.

The bar: fresher vs SDE-2

FresherSDE-2
UploadUpload to S3Resumable, direct, validated, with visible status
Processing"Convert to MP4"Segment-parallel DAG, ladder, progressive publishing, retries
PlaybackDownload the fileHLS/DASH with ABR, buffer-aware, segment length trade-offs
Delivery"Use a CDN"Egress maths, ISP caches, shields, immutable segments, multi-CDN
CountsIncrement a columnWatch threshold, de-duplication, sharded counters, async fraud checks

Common mistakes

  • Serving the original file instead of a ladder of segments.
  • Transcoding a whole video on one machine.
  • Uploading through app servers, or without resume.
  • Forgetting egress cost and scale; treating the CDN as an afterthought.
  • UPDATE videos SET views = views + 1 on every play of a viral video.

Quick check

Five questions on this chapter. Pick an answer, then check it.

quiz