← Questions
Design Spotify: music streaming, search and playlists
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Design a music streaming service like Spotify for hundreds of millions of listeners and a catalog of over 100 million tracks. Users search for music, build playlists, get recommendations, play music smoothly over poor networks and download tracks for offline listening.
Requirements
- Functional: catalog of artists, albums and tracks; search; play with seeking; playlists that users create and share; recommendations; offline downloads; play history.
- Non-functional: playback starts in a fraction of a second; adapts audio quality to the network without stopping; serves hundreds of millions of users worldwide; licensing rules by country; offline files protected from copying.
Clarifying questions
- How many daily users and concurrent streams at peak?
- Which audio qualities, and how large are files?
- How fresh must recommendations and play counts be?
- Which licensing rules must be enforced, and where?
- Do we cover podcasts and video, or music only?
What a strong answer covers
- Audio storage: each track encoded at several bitrates, split into segments, kept in object storage and served through a CDN; popular tracks cached at the edge.
- Playback: the client fetches segments, buffers ahead, switches bitrate with network conditions, and prefetches the next track.
- Metadata and search: a catalog service and a search index with typo tolerance and popularity ranking.
- Playlists: a data model for very large and shared playlists, with concurrent edits.
- Play events into a stream for history, royalties and recommendations; recommendations computed offline and refreshed.
- Offline downloads with encrypted files and license checks; country rights checks at play time.
Follow-ups
- A huge artist releases an album at midnight worldwide.
- A user on a train keeps losing connection.
- Count plays accurately enough to pay royalties.
- Collaborative playlists edited by many people at once.
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. Free with an account: one full answer per company.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. Free with an account: one full answer per company.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing


