System design round

Design Live Streaming for the IPL Final

Fifty million people watching one match is mostly a CDN problem, and the CDN part is well understood. What falls over is everything else: the app’s own APIs when a wicket brings millions back at once.

Estimate, draw your design, run its traffic through it and see which boxes break. Then answer the follow-up questions. The load test is free and needs no account; an AI review or score uses one of your AI replies.

The brief

It must

  • Live video to phones and TVs at several qualities, switching with the network.
  • The app’s home page, scorecard and login keep working at the biggest moments.
  • A live score on screen for every viewer.
  • One CDN failing must not take the stream down.

The numbers

  • Assume 50 million people watch the final at once.
  • Video comes in 4-second segments; players refresh the playlist about as often.
  • The app makes about 80,000 API calls a second during play, and five times that when a wicket falls.
  • Players poll a small live-score file every 5 seconds.

Before you draw: the numbers

Interviewers expect a quick estimate first, because the numbers decide the design. Write yours, then check.

The load test uses round numbers per box, the kind you would use on a whiteboard, so it shows where a design breaks and roughly by how much, not exact figures. How it works

The follow-up questions

Once your design is up, the interviewer goes deeper. Each question changes one thing and is a level further, Fresher to Senior. An AI interviewer scores your answer; 6 out of 10 or more climbs the rung.

JioHotstar live IPL

Not climbed yet

Our design, and why

Try your own first. “Our design” on the board shows it as boxes you can load-test.

Segments are the same file for everyone watching the same quality, which makes 25 million requests a second a caching problem. Edges serve nearly all of them from memory, request collapsing lets thousands of simultaneous misses share one fetch, and an origin shield means the origin sees a handful of requests per segment however many people watch.

  • More than one CDN. At this scale one provider’s capacity in one country runs out, and one provider’s outage would be yours. Steer by measured performance, in DNS or in the player.
  • The API is the weak point. A wicket brings millions back into the app within a minute. Cache the home page and scorecard at the CDN for a few seconds (they are the same for everyone), pre-scale for moments you can see coming, and have switches that turn off recommendations and comments under load.
  • The score is a small JSON file on the CDN with a one- or two-second TTL, polled every five seconds with jitter: 10 million requests a second at the edges and almost none at the origin. Pushing it would need hundreds of WebSocket servers for a number that changes once a ball.
  • Jittered retries in the app, so a struggling API is not hit by millions of phones retrying in step.

Count viewers from heartbeats, sampled: 1% of players reporting every 30 seconds, multiplied back up, is accurate enough for a number shown rounded. Never query a database per viewer.

What each level is expected to cover

The AI review grades your board against these.

Fresher
  • Encoder, segments (HLS/DASH), origin and CDN.
  • Adaptive bitrate.
SDE 1
  • The segment request arithmetic.
  • Edge caching, an origin shield, and multiple CDNs.
SDE 2
  • The app APIs as the real risk at big moments.
  • Caching API responses at the CDN, pre-scaling, graceful degradation, jittered retries.
Senior
  • Live score delivery: polling a CDN-cached file versus push, with the costs of each.
  • Viewer counts from sampled heartbeats or HyperLogLog.
  • Keeping the score from running ahead of the video.

How the load test works

Each round sends a few kinds of traffic from its users, at the rates in the brief. The test follows your arrows: a CDN answers what it can cache, a load balancer spreads requests, a service runs the logic and checks a cache beside it before the database, and a queue takes work off the request so the boxes after it work at their own pace.

Every box takes a rough number of requests a second (one service machine about 5,000, one Redis node about 100,000, one SQL primary about 3,000 writes, one row about 200 updates). A box asked for more turns red and drops the excess, unless a queue in front holds it back, in which case the queue grows and the work waits. Failure scenarios take machines away; a standby copy covers one.

It cannot see correctness: idempotency, consistency, and what users see when something fails. Write those in a box’s note; the AI review reads them.

blur