Spotify is a popular digital music streaming platform that gives users access to a vast library of songs, albums, podcasts, and audio content from artists and creators around the world.
It offers features such as:
In this chapter, we will explore the low-level design of a Spotify like service in detail.
Lets start by clarifying the requirements:
Before starting the design, it's important to ask thoughtful questions to uncover hidden assumptions and better define the scope of the system.
Here is an example of how a conversation between the candidate and the interviewer might unfold:
Candidate: Should we support both free and premium users?
Interviewer: Yes. Free users should experience occasional ads during playback. Premium users should enjoy uninterrupted, ad-free listening.
Candidate: Do users interact only with individual songs, or can they also play albums and playlists?
Interviewer: Users should be able to play individual songs, albums, and playlists. These should be handled uniformly.
Candidate: Should users be able to follow artists and get notified when a new album is released?
Interviewer: Yes. Users can follow artists and should receive notifications whenever those artists release new albums.
Candidate: Should the music player support playback controls like play, pause, and next track?
Interviewer: Yes. The user should be able to control playback using these actions. The player should behave differently based on its current state (stopped, playing, paused).
Candidate: Is search functionality in scope?
Interviewer: Yes. Users should be able to search for songs by title and artists by name.
Candidate: Do we want to show song recommendations?
Interviewer: Yes. Include a simple recommendation engine. For now, simulate genre-based or randomized recommendations.
After gathering the details, we can summarize the key system requirements.