Open this on a laptop
The canvas needs room: requirements on one side, live feedback on the other. Any screen 1024px or wider works.
Design Spotify
mediumListeners find any of 100 million tracks as they type, hear it at once, and every play is counted once.
The problem
Build music streaming like Spotify. Listeners search a catalogue of 100 million tracks and play any of them, on a phone, a laptop, a car or a speaker.
Behind the play button sit two systems: one answers small questions (which tracks match, may I play this), the other moves terabits of audio. The audio never passes through your servers.
Every real play pays an artist, so it must be counted exactly once: never lost, never twice.
What it must do
- Search. Results appear as you type and forgive a misspelling. They come from a search index filed by word, kept in step with the catalogue.
- Play. Check the listener may play the track, then hand the app a signed link that works for a few minutes. The app fetches the audio a few seconds at a time, from a CDN near it.
- Count plays. The app reports each play with an id it made up. Reports go on a queue, repeats are dropped, a play counts after 30 seconds, and the totals go to a royalty ledger.
What you'll learn
- Start with the simplest design that works
- Keep running when a server dies
- Find tracks as people type
- Bring the audio close to the listener
- Survive a midnight album drop
- Count every play exactly once