Design Spotify: Music Streaming System Design Interview
ow to design Spotify in a system design interview, the way the round runs — requirements, the control-plane and data-plane split, and the deep dives that decide it: how audio is chunked, served from a CDN via short-lived signed URLs with next-track prefetch for gapless playback, how the huge read-heavy catalog and collaborative playlists are stored and cached, and how Discover Weekly is batch-computed from listening signals. Built around the follow-ups an interviewer pushes.
November 21, 202619 min read

Design Spotify: the music streaming system design interview walkthrough
The request to design Spotify sounds like "store some MP3s and stream them." The scale is what makes it an interview: six hundred million users, a billion streams a day, petabytes of audio bytes leaving your network daily, and a hard promise that music starts playing within about two hundred milliseconds of a tap. You cannot serve that from one origin, and you cannot route a billion audio streams through your own API servers. So the real design splits into a lightweight control plane that authorises a play and hands back a pointer, and a massive data plane — a CDN — that actually ships the audio bytes, plus a huge read-heavy catalog and a personalised-discovery layer on the side. This is a classic music streaming system design interview prompt because the obvious "fetch the file and send it" answer melts at this bandwidth, and the interesting answer is about where the bytes flow and how little your own servers touch them.
The round turns on three decisions. First, audio delivery — how a song becomes CDN-cacheable chunks served to the player fast, via short-lived signed URLs, with the next track prefetched so playback is gapless. Second, the catalog and playlists — how a hundred-million-track catalog and user playlists stay fast under an overwhelmingly read-heavy load. Third, discovery — how Spotify builds something like Discover Weekly from the listens, skips and saves users leave behind. This walkthrough follows the path a strong candidate draws on the whiteboard — requirements, estimate, API and data model, high-level design, then the deep dives — and at each step it names the follow-up the interviewer uses to tell a memorised answer from an engineer who understands the tradeoff.
How the Spotify round is actually run
A Spotify round runs about 60 minutes on a shared canvas — you draw the boxes and arrows while you talk, and the interviewer interrupts. It is a favourite media-and-analytics problem because the one-line brief hides the single most important move in large media systems: separate the control plane from the data plane so your servers never carry the heavy bytes. The moment you say "the user taps play," the real questions appear — how does audio start in 200ms, how do you serve a billion streams without your origin melting, and how do you make the catalog and playlists feel instant — and the answer is the CDN-plus-signed-URL pattern that every streaming service shares. Get that split, the catalog caching and the discovery pipeline clean and you have shown a whole class of systems in one problem.
The interviewer rarely lets "the playback service reads the file and streams it to the user" stand. "A billion streams a day is petabytes of audio leaving your network. If every one of those bytes flows through your playback servers, what happens — and where should the bytes actually come from?" That question — keeping the heavy data off your own servers — is the one a copied answer can never rehearse, and the one this round is really testing.
The rounds here are modelled on how the loop runs, not scraped from any candidate's recall. What matters for prep is the shape: a blank canvas, a clock, and a follow-up after every decision you make.
The five-step framework for any HLD round
Every high-level design answer fits the same spine. Say it out loud at the start so the interviewer knows you have a plan, then walk it:
- Clarify requirements — what plays, the latency promise, offline, playlists, and how deep the recommendations go.
- Estimate — users, streams per day, audio bandwidth, and the read/write skew, to justify the CDN and caching.
- High-level design — the control plane (auth, metadata, playlists, recs) and the data plane (CDN + object storage).
- Deep dive — the two or three decisions that actually decide this system.
- Follow-ups — bottlenecks, failure modes, and what you would change at ten times the scale.
What the debrief measures
The score is not "right or wrong design." A good HLD debrief reads on four dimensions, and every move below maps to one: problem solving (did you keep audio bytes on the CDN and off your servers, and prefetch for gapless playback), communication (did you explain the control-plane/data-plane split and signed URLs in a sentence), technical execution (chunked audio on a CDN, short-lived signed URLs, a cached read-heavy catalog, batch-computed discovery), and time management (did you spend your 60 minutes on delivery, catalog and discovery, not on the login screen). Reading a walkthrough teaches the design; it does not teach you to deliver it on the clock while someone pushes back.
Step 1 — Requirements: what Spotify must do
Spend the first few minutes here. Jumping to boxes before you have scoped the problem is the fastest way to design the wrong system.
| Type | Requirement |
|---|---|
| Functional | Browse and search a huge catalog; stream a track on demand with instant start; create and edit playlists (including collaborative ones); get personalised recommendations and curated playlists; download for offline; sync across devices. |
| Functional (optional) | Podcasts, social sharing, lyrics, crossfade, artist pages, content ingestion — call these out, then scope most of them (ingestion is a separate system). |
| Non-functional | Audio starts within ~200ms of pressing play; very high availability (99.99%); enormous audio bandwidth (petabytes/day); read-heavy (plays and browses ≫ writes); rare buffering on variable networks; scalable and globally distributed. |
The sentence that earns points: "A billion streams a day is petabytes of audio, so the heavy bytes must come from a CDN, not my servers — I'll split a lightweight control plane (auth, metadata, playlists) from a data plane (CDN + object storage), hand the client a short-lived signed URL, and let the edge serve the audio." Say that and you have framed the entire design before drawing a box.
Step 2 — Capacity estimation (back of the envelope)
Estimation here is about proving one thing: the audio bandwidth is the dominant cost, which is exactly what forces the CDN-and-signed-URL design.
| Quantity | Assumption | Result |
|---|---|---|
| Users | ~600M MAU, ~200M DAU | enormous concurrent playback demand |
| Streams | ~1B streams/day | ~tens of thousands of stream starts/sec at peak |
| Audio bandwidth | ~a few MB/track streamed, at scale | ~petabytes/day → must be served from CDN edge, not origin |
| Catalog | ~100M tracks + rich metadata | metadata is large but cacheable; read-dominated |
| Read:write | plays/browses ≫ playlist edits | ~1000:1+ → cache the catalog; writes (playlists, history) are modest |
Two conclusions fall out, and you should say both out loud. First, the bytes must live on the CDN — a billion streams a day is petabytes of egress, and routing that through your own playback servers is impossible, so audio is chunked, pushed to CDN edges, and served from the nearest edge; your servers only authorise and hand back a URL. Second, everything else is read-heavy metadata — the catalog and playlists are read far more than written, so they are heavily cached, and the only real writes are playlist edits and the listening-history stream that feeds discovery. You have now pointed the interview at audio delivery and the catalog — the real deep dives — before anyone asked.
Step 3 — API and data model
The interface separates a lightweight control call (get a stream URL) from the heavy data fetch (the audio itself from the CDN).
| Call | Operation |
|---|---|
getStreamUrl(track, quality) → signed_url | control plane: authorise (subscription, region), pick the bitrate, return a short-lived signed URL to the CDN |
GET {signed_url} (to the CDN) | data plane: the client fetches audio chunks directly from the CDN edge — never through the API servers |
search(q) / getPlaylist(id) / editPlaylist(id, op) | catalog search, read a playlist, apply a playlist edit |
logPlayback(user, track, event) | record play/skip/complete — the signal stream that feeds discovery |
The data model spans the audio artifacts, the catalog, playlists, and the listening log:
| Entity | Notes |
|---|---|
audio_object | a track encoded at several bitrates, split into small chunks (static files) in object storage, distributed to CDN edges. |
track / album / artist | catalog metadata, read-dominated, heavily cached (and partly CDN-cached). |
playlist | an ordered list of track ids owned by a user; may be collaborative (multiple editors); edits must not be lost. |
playback_event | user, track, event (play/skip/complete), ts — the implicit-feedback stream behind recommendations. |
Step 4 — High-level design: control plane and data plane
Now the boxes. A music streaming service is two planes — a light control plane your servers run, and a heavy data plane the CDN runs:
- Client → API gateway (control plane): the gateway authorises the request (subscription, region, entitlements) and routes to the right service.
- Playback service → signed URL: on a play, the playback service picks the bitrate, generates a short-lived signed URL (minutes-long expiry) pointing at the audio in the CDN, and returns it — it never streams audio itself.
- CDN + object storage (data plane): the client uses the signed URL to fetch audio chunks directly from the nearest CDN edge; popular tracks are already cached at the edge, so the origin object store is rarely touched.
- Catalog & search + playlist services (control plane): serve metadata and playlists from databases fronted by heavy caches, because reads dominate.
- Discovery (offline): a recommendation pipeline consumes the playback-event stream and builds personalised playlists (Discover Weekly) in batch, published for the client to read.
Say explicitly that you separate the control plane from the data plane — your servers do lightweight authorisation and URL signing, while the CDN does the heavy audio delivery — because that is the only way a billion streams a day is survivable, and the signed URL is what lets the client hit the CDN directly while still enforcing access. Naming the two-plane split and signed URLs unprompted is a signal the interviewer is listening for.
Deep dive: audio delivery — CDN, signed URLs and prefetch
This is the decision that decides the round, because it is where the petabytes go. The whole trick is to get audio to the player fast while keeping it off your own servers.
Chunked audio on a CDN. Before a track can be streamed it is encoded at several bitrates and split into small chunks — static files that are ideal for a CDN: they cache well at the edge, support efficient seeking (jump to any chunk), and let the client step up or down a quality level on a bad network. Popular songs sit cached at edge locations worldwide, so a listener in Tokyo gets bytes from a nearby edge, and the origin object store handles only cache misses. This is why the CDN can serve millions of concurrent streams the origin never could.
Signed URLs and the two planes. The player does not stream through your API; the playback service returns a short-lived signed URL (an expiry of minutes) that grants direct, time-limited access to the audio on the CDN. Authorisation (subscription, region) happens once on the control plane; the heavy byte transfer happens on the data plane. The expiry stops the URL being shared or reused indefinitely.
Prefetch for gapless playback. To make playback feel instant and gapless, the client prefetches — it buffers the start of the current track for the ~200ms start promise and fetches the next track's first chunks before the current one ends, so there is no gap between songs. Offline download is the same idea taken further: the client stores encrypted chunks locally for playback without a network. Naming prefetch and the signed-URL/CDN split is exactly what the interviewer wants here.
"A billion streams a day — how does audio start in 200ms without your servers carrying the bytes?" Audio is chunked and cached on CDN edges; the playback service only authorises and returns a short-lived signed URL, and the client fetches chunks straight from the nearest edge — your servers never touch the audio. Prefetch the next track's chunks for gapless playback. Name chunked CDN delivery, signed URLs, and prefetch.
Deep dive: the catalog, search and playlists
This is the decision most candidates skip past, but it is most of what a user actually touches. A hundred-million-track catalog and everyone's playlists are read constantly and written rarely — so the whole layer is a caching story, with one concurrency trap.
A read-heavy catalog and search. Track, album and artist metadata is read far more than it changes, so it lives in a database fronted by a heavy cache (and some of it, like artwork, on the CDN), and a search index (inverted index) serves text queries over the catalog. Because the data is relatively static and overwhelmingly read, replicas and caching carry the load easily — this is the easy half.
Playlists and the collaborative-edit trap. Playlists are user-owned ordered lists of track ids, cheap to store. The subtlety the interviewer probes is collaborative playlists: when two people edit the same playlist at once, naive last-write-wins silently loses an edit. You handle it with per-edit operations (append/remove/reorder) applied against a version, or a conflict-resolution scheme, so concurrent edits merge instead of clobbering — "a playlist that never loses an edit." Everything else about playlists is ordinary reads and writes; the collaborative case is the one worth naming.
"Two people add songs to the same shared playlist at the same second — does one edit vanish?" Not if you apply edits as operations (append/remove/reorder) against a version and merge them, rather than overwriting the whole list last-write-wins; concurrent edits then both survive. The catalog itself is read-heavy, so it's cache-and-replica. Name the read-heavy cache and the collaborative-edit merge.
Deep dive: personalised discovery (Discover Weekly)
This is the decision that shows you know where recommendations fit in the architecture — and, crucially, that most of it runs offline, not on the play path. Discover Weekly is a curated playlist, built in batch from the traces users leave.
Signals and the batch pipeline. Every play, skip, save and completion is logged to the playback-event stream; a batch pipeline consumes that history and builds personalised playlists. The core method is collaborative filtering — people with similar listening taste like similar tracks — often blended with content features of the audio and editorial curation. Because Discover Weekly refreshes on a schedule (famously weekly), it is computed offline and simply published for the client to read, so the expensive modelling never sits on the latency-critical play path.
Retrieval then ranking, feeding back. Under the hood it is the same discovery shape as search ranking: cheap candidate generation (similar-taste tracks, co-listening, audio similarity) narrows the catalog, then a ranker orders the candidates for the user. The listening signals close the loop — what you play and skip this week shapes next week's picks — and that feedback (with the usual care about only learning from what you surfaced) is what makes it feel personal. Keeping discovery offline and batch, separate from playback, is the architectural point to make.
"Where does Discover Weekly run, and what is it built from?" Offline, in batch — a pipeline consumes the logged play/skip/save stream and uses collaborative filtering (plus audio/content features) to generate and rank personalised tracks, then publishes the playlist for the client to read. It never runs on the 200ms play path. Name the batch pipeline, collaborative filtering, and that it's offline.
The follow-ups that decide the Spotify round
Scan the probes from each deep dive and they rhyme. Master these five and you are ready for a version of the question that is not drawn exactly like this one.
- "A billion streams a day — where do the audio bytes come from?" → CDN edges, not your servers: audio is chunked and edge-cached, and the playback service only returns a short-lived signed URL. (problem solving)
- "How does playback stay gapless and start in 200ms?" → Prefetch — buffer the current track's start and fetch the next track's first chunks before it ends; offline stores encrypted chunks locally. (technical execution)
- "A 100-million-track catalog — how is it fast?" → It is read-heavy and relatively static, so it is cache-and-replica with a search index; writes are rare. (communication)
- "Two people edit a shared playlist at once — does an edit vanish?" → No, if edits are operations applied against a version and merged, rather than last-write-wins over the whole list. (problem solving)
- "Where does Discover Weekly run?" → Offline in batch — collaborative filtering over the logged listening stream, published for the client; never on the play path. (technical execution)
Each maps to a debrief dimension. Reading this list teaches you the answers; it does not teach you to deliver them while someone interrupts — that only comes from saying them out loud.
How to prepare: a one-week plan
You do not need fifty systems. You need this one cold and the framework automatic, so the next "design X" is just new nouns in the same five steps.
- Days 1–2: Learn the five-step framework until it is reflex. Do Spotify end to end on paper — requirements, estimate, data model, the control-plane / data-plane split and the client → gateway → playback/CDN path.
- Days 3–4: Drill audio delivery: chunked audio on a CDN, signed URLs, the control/data-plane split, prefetch for gapless playback, and offline. Say each tradeoff in one sentence.
- Days 5–6: Own the catalog and discovery — read-heavy caching and search, collaborative-playlist merges, and the offline batch recommendation pipeline. Answer each of the five follow-ups out loud.
- Day 7: A full timed 60-minute round, narrating the whole way, with someone (or something) interrupting. This is the rep that counts.
This post is the deep walkthrough behind one row of the broader Top 25 system design interview questions — once the streaming design is automatic, the same spine carries the rest of the list.
Frequently asked questions
How do I design Spotify step by step?
Follow the five-step HLD framework. Clarify requirements (browse/search a huge catalog, stream with ~200ms start, playlists including collaborative, personalised discovery, offline — read-heavy, petabytes of audio bandwidth, 99.99% uptime); estimate to show the audio bandwidth dominates, which forces CDN delivery; define the getStreamUrl/search/playlist API and the audio_object/track/playlist/playback_event model; draw the control-plane (auth, playback, catalog, playlist, discovery) and data-plane (CDN + object storage) split, where the playback service returns a signed URL and the client fetches chunks from the CDN; then deep-dive the three decisions that matter — audio delivery with CDN/signed URLs/prefetch, the read-heavy catalog and collaborative playlists, and offline batch discovery.
How does Spotify stream audio with such low latency?
By keeping the audio bytes on a CDN and off its own servers, and by prefetching. Each track is encoded at several bitrates and split into small static chunks that cache well at CDN edges worldwide, so a listener gets audio from a nearby edge rather than a distant origin; popular songs are already cached everywhere, letting the CDN serve millions of concurrent streams the origin never could. The playback service only authorises the request and returns a short-lived signed URL pointing at the CDN, so the heavy transfer happens on the data plane while the control plane stays lightweight. To hit the ~200ms start and keep playback gapless, the client prefetches — buffering the current track's start and fetching the next track's first chunks before the current one ends.
What is the control-plane / data-plane split in a streaming design?
It is the separation between the lightweight logic your servers run and the heavy data a specialised layer moves. The control plane handles authorisation (subscription, region, entitlements), metadata, playlists and signing a URL — small, cheap requests your API servers can handle at scale. The data plane is the CDN plus object storage that actually delivers the audio bytes, which at a billion streams a day is petabytes and would crush any origin fleet. The signed URL is the bridge: the control plane verifies access once and hands the client a short-lived, direct link to the CDN, so the bytes never flow through your servers. This split is the single most important pattern in large media systems and is why a streaming service can scale.
How are collaborative playlists kept consistent?
By treating edits as operations rather than full overwrites. A playlist is an ordered list of track ids, and when a single user edits it there is no problem; the trap is a collaborative playlist that two people edit at the same moment, where a naive last-write-wins save of the whole list silently drops one person's change. Instead you apply discrete operations — append, remove, reorder — against a version of the playlist, and merge concurrent operations (or use a conflict-resolution/CRDT-style scheme) so both edits survive. That is what lets a shared playlist "never lose an edit" even under simultaneous changes, while the rest of the catalog, being read-heavy and static, is handled simply with caches and replicas.
Where does Discover Weekly run in the architecture?
Offline, in a batch pipeline, deliberately kept off the latency-critical play path. Every play, skip, save and completion is logged to a playback-event stream, and a scheduled batch job consumes that listening history to build each user's personalised playlist, mostly through collaborative filtering — users with similar taste like similar tracks — blended with audio/content features and editorial curation. Because the playlist refreshes on a schedule rather than per request, the expensive modelling runs in batch and the result is simply published for the client to read, so recommendations never slow down playback. Under the hood it is the same retrieval-then-ranking discovery shape as search ranking, with the listening signals feeding back to shape future weeks.
How do I practise a system design interview out loud?
Reading a walkthrough is not the same as defending a design while someone interrupts. On Zynter, the HLD track runs live voice rounds modelled on how real system design loops run — you talk through a shared design on the canvas, and a voice interviewer pushes with the follow-ups above one at a time, then gives you a debrief on problem solving, communication, technical execution, and time management. The score is a practice signal, not a hiring decision.
Practise it on Zynter
You can say "use a CDN." The round is won on the control/data-plane split and gapless prefetch.
Pick the streaming round, draw the control-plane / data-plane split on the canvas, and defend it out loud to a voice interviewer that keeps asking "where do the audio bytes come from?" and "how does the next song start with no gap?" — then read the debrief. Zynter.ai is on-demand mock interviews modelled on real company loops, with 150+ rounds across 20 companies including the HLD system design track (Sep 2026).
Practise the streaming round → Browse all interview tracksAlmost nobody freezes on the code. They freeze on the follow-up.
Answer a real round to a voice interviewer that keeps asking why. No scheduling, no subscription, first session ready in under a minute.
Keep reading
All posts
ACID Properties in DBMS Explained for Interviews
How to explain ACID properties in a system design interview — what atomicity, consistency, isolation and durability each guarantee for a database transaction, the isolation levels and the read anomalies they prevent (dirty, non-repeatable and phantom reads), ACID vs BASE and when you relax the guarantees for scale, and how databases implement them with write-ahead logs and locking or MVCC — with the follow-ups you answer out loud.
Gowtham PotureddiNov 21, 202615 min read

API Gateway Explained for System Design Interviews
How to explain and defend an API gateway in a system design interview — what it actually does as the single entry point to a microservices backend (routing, authentication, rate limiting, TLS termination, aggregation, observability), how it differs from a load balancer and a reverse proxy, the failure modes interviewers probe (the gateway as a single point of failure, latency, the fat-gateway anti-pattern), and the BFF pattern — with the follow-ups you answer out loud.
Gowtham PotureddiNov 21, 202615 min read

Design a Live Video Comments System: System Design Interview
How to design a live video comments system in a system design interview, the way the round runs — requirements, the real-time fan-out architecture, and the deep dives that decide it: why you push with SSE instead of polling and separate read from write traffic, how pub/sub with viewer co-location fans a comment to the right servers, and how mega-streams switch to sampling and CDN snapshots when millions watch at once. Built around the follow-ups an interviewer pushes.
Gowtham PotureddiNov 21, 202621 min read