The interview problem

Practice prompt

Deliver a two-hour live concert to one million concurrent viewers. Most join just before the first song. Target roughly fifteen seconds of glass-to-glass delay, support adaptive quality and survive an origin outage without overwhelming the backup. Work through bandwidth, request rates and stream continuity.

Original system-design practice, not a reported company interview. All workload figures are hypothetical. RFC 8216, published August 2017, was retrieved September 27, 2026. This design uses ordinary segmented HLS; it does not claim to implement later low-latency extensions.

1. Define the viewer experience

Separate startup time, live delay, rebuffering and video quality. A player may start quickly by playing older content while remaining far behind the live edge. Measure capture-to-display delay using a trustworthy source time reference, and playback availability from clients rather than only origin HTTP success.

Choose an explicit trade-off: this concert tolerates seconds of delay to gain buffering and broad HTTP-cache distribution. Interactive conversation would need a different latency architecture. Preserve synchronized audio, video and captions, with a defined DVR window and a path to the final recording after the event.

2. Make the media path cacheable

dual contribution feeds → redundant encoders
                                  ↓
                    aligned rendition packagers
                                  ↓
                 immutable segments + live playlists
                                  ↓
                  replicated origins → origin shields
                                  ↓
                         CDN edges → players

admission / entitlement / telemetry operate beside the media path

Encode a bitrate ladder with aligned segment boundaries and suitable random-access points for switching. Publish each complete media object durably before a playlist references it. Update playlists atomically so a reader sees a complete old or new version. Keep segment URLs immutable and include an event/stream generation; never reuse a filename for different bytes after encoder restart.

Give media objects long cache lifetimes within their retention policy. Live playlists need a freshness policy consistent with the update cadence. A highly cached but stale playlist freezes progress even if every HTTP response is successful. Avoid prolonged negative caching of a segment that was requested just before publication.

RFC 8216 defines playlist, segment, variant and discontinuity concepts. It is an informational specification for protocol version 7, not a complete recipe for this service's redundancy, entitlement or capacity strategy.

3. Size bytes and requests separately

Assume average delivered audiovisual bitrate of 4 Mb/s per viewer. One million viewers require 4 Tb/s of edge egress. Over two hours that is 4×10¹²×7,200/8=3.6×10¹⁵ bytes, or 3.6 PB decimal, before protocol overhead and retransmissions. Origin bandwidth should be much smaller through caching; viewer egress still exists regardless of the origin hit rate.

With four-second muxed audiovisual segments, each viewer fetches about one segment every four seconds: 250,000 segment requests/second on average. At 4 Mb/s, one segment is about 2 MB. Separate audio, captions, playlist reloads, retries and quality switches add requests. Segment publication synchronizes viewers, so peak request rate can greatly exceed the average.

Suppose eight renditions are needed at 200 edge locations. In an idealized cache model with one fill per rendition per location per four-second segment, edge fills total 8×200/4=400 requests/second. This is not a guaranteed origin rate: eviction, multiple cache instances, personalization and cold starts can multiply fills. Shields and request coalescing reduce duplicate upstream fetches, but must be load-tested under cold-cache conditions.

4. Budget live delay without double counting

An illustrative pipeline allocates one second to capture/encoding, up to four seconds for the relevant segment to complete, one second for publication and transfer, and eight seconds of intentional player buffering beyond that path. The total is up to fourteen seconds under these assumptions, leaving about one second against the fifteen-second target. The one-second transfer allocation for a 2 MB segment alone requires about 16 Mb/s of effective download throughput, before publication overhead; it is not guaranteed by a 4 Mb/s stream bitrate. Actual segment phase, playlist discovery, network variation and decoder behavior change the result; validate the measured end-to-end distribution.

Shorter segments reduce packaging wait but increase request overhead and cache churn. Less player buffer reduces delay but increases vulnerability to throughput dips. The player should adapt bitrate conservatively and avoid endlessly falling behind the live edge after a stall. Catch-up may require bounded faster playback or skipping to a safe later boundary, with a user-visible trade-off.

Do not promise exact synchronization among all viewers. Devices and network paths differ. Establish an acceptable skew range if synchronized companion experiences matter, and use measured playback position rather than assuming the latest playlist implies the latest displayed frame.

5. Protect the opening-minute surge

Prewarm event metadata, manifests where appropriate and the static pre-event slate. Future concert segments cannot be prewarmed before they exist. Exercise realistic request bursts at segment boundaries and entitlement requests when many users join at once.

For 300,000 joins in one minute, average admission rate is 5,000/second, before retries and burst concentration. An entitlement dependency sized only for steady playback can prevent viewers from starting even when the CDN has ample media capacity. Use bounded admission work, short-lived scoped playback authorization and a documented outage policy.

Authorize at the edge before serving protected media, including cache hits. A shared media cache key may omit viewer-specific signatures only if authorization is checked separately and the bytes are identical for all authorized viewers in that cache class. Never omit tenant, rendition, encryption or personalization dimensions that change the content. Personalized manifests or ad segments may require separate cache treatment.

6. Fail over a timeline, not just a hostname

Replica origins must serve a coherent playlist and its referenced segment objects. Switching to a backup whose manifest is newer than its media objects produces stalls. Track manifest generation and object availability together; a backup may deliberately lag the live edge while catching up, but it must still supply the segments existing clients need next. Do not send an established client to a playlist that regresses behind its consumed sequence or lacks its next segment; preserve a compatible overlap or perform an explicit player resynchronization.

Redundant encoders can produce different bytes and timestamps even from the same input. If continuity cannot be preserved, publish a new stream generation with the appropriate discontinuity signaling and valid initialization data. Do not assume identical media-sequence numbers across unrelated playlists identify the same content. Test player transitions across codecs, encryption keys and timestamp changes.

Origin health must include advancing media timestamps and decodable segment probes. A frozen encoder can keep returning HTTP 200. When a feed fails, an approved slate or alternate feed is preferable to retrying a nonexistent segment indefinitely. Preserve honest telemetry distinguishing fallback content from healthy concert playback.

Shift traffic gradually where possible and protect the backup with coalescing, shield capacity and retry limits. A CDN switch can create a cold-cache flood. Correlated provider or upstream-network failures mean two delivery providers are not automatically independent; rehearse the actual failure paths.

7. Retain enough for slow clients

A sliding playlist removes old references, but clients may still be fetching them. Retain media according to protocol availability requirements and the supported DVR/seek contract, with margin for in-flight clients. Storage cleanup must not simply delete an object the moment it disappears from the newest playlist.

At event completion, publish a consistent final playlist and recording policy. Keep rights and entitlement enforcement valid through replay. Collect startup failures, stalls, live delay and rendition changes with sampling and aggregation that can tolerate the audience scale; telemetry must not become a new critical dependency for playback.

Compare client metrics across regions, networks and devices. Origin request counts are not viewers, and concurrent playback sessions are not unique people. Separate synthetic probes from audience measurements.

8. Trade-offs and self-review

Long buffers improve resilience but increase live delay. More renditions improve adaptation while raising encoder and cache-fill costs. Multi-provider delivery expands options but complicates cache warming and coherent failover. Personalized content reduces cache sharing.

Follow-ups: Can a CDN remove the cost of viewer egress? No. Does HTTP success prove fresh video? No. Can future segments be prewarmed? No. Is a segment URI reusable after a restart? Not safely for different bytes. Does redirecting to a backup guarantee timeline continuity? No.

Score 0–2 each for media publication ordering, bandwidth/request arithmetic, latency accounting, origin protection and timeline-aware recovery.

Sources and next steps

Architecture and workload calculations are original. This guide emphasizes live publication and synchronized demand rather than an already-produced video catalog.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.