Problems / Real world, hard
Asked at Netflix and YouTube. Every video segment is served by origin servers reading object storage, manifests come from Postgres, and DRM licenses from license servers, all through the same origin fleet. At 6 s a premiere starts and traffic triples for 12 seconds; at 13 s the segment storage is unavailable for 4 seconds.
Unlock it once for 25 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.
Success ≥ 99.5%, p99 ≤ 1.5 s and Apdex ≥ 0.90 through the premiere, for at most $100,000 a month.
Like a coding problem, a solution has to pass every case, not just the one it was built for. Submit in the lab runs all 3; 1 of them are hidden until then.
15,000 requests a second for 20 seconds: 90% segment (reads), 8% manifest (reads), 2% license (reads).
What each component does in this design, and what calls it. The simulator mimics each one from these settings.
| Component | Its job here | Settings |
|---|---|---|
| Load balancerLoad balancer | Traffic enters here.Calls Origin servers.Layer 4 balancers route by IP and port; layer 7 balancers read HTTP and can route by path or header. | – |
| Origin serversApp service | Load balancer forwards to it.Calls Video segments (object storage), Titles and manifests (Postgres), DRM license servers.Little's law: throughput ≈ concurrency ÷ latency. 200 slots at 50 ms serve about 4,000 req/s. | 20 replicas × 100 slots · timeout 3.0 s |
| Video segments (object storage)Object storage | Origin servers calls it for /segment.Object stores like S3 keep copies across devices and facilities for very high durability. | 3000 slots · 300,000 calls/min |
| Titles and manifests (Postgres)SQL database | Origin servers calls it for /manifest.Postgres runs one process per connection, which is why poolers like PgBouncer sit in front of busy databases. | 8 vCPU · 400 connections |
| DRM license serversDRM license server | Origin servers calls it for /license.Protected video is encrypted once; the player fetches a short-lived key from a license server before it can play. | 400 slots |