Global Music Streaming Platform
Design global music search, personal libraries, creator uploads, and reliable playback, then audit a consistent-hash origin under balanced current load.
Problem statement
Design a global music platform where users search a catalog, save songs, manage playlists and a personal library, stream audio, and retain listening history. For this exercise, assume an authenticated user selects a catalog track, receives a short-lived authorized playback URL, and may resume from the last saved position. Assume 100 million tracks and 10 million concurrent listeners at peak; playback should begin within 300 ms at p95 with 99.99% availability. A playlist contains at most 10,000 tracks, listening events are retained for one year, and recommendation-model training is outside scope. Explain metadata search, user-state ownership, audio delivery, scaling, and failure behavior. For this exercise, also assume an authenticated creator can upload one audio source of at most 100 MB, observe pending, ready, or rejected processing, and publish a new immutable track or rendition version. Pending or rejected versions must never be playable; ready publication requires durable verified audio and a usable manifest. A timeout may leave the result uncertain, so the creator can safely retry or check status. This asynchronous upload journey is separate from the 300 ms playback-start target. The proposed consistent-hash origin currently has equally distributed serving load; accept that premise when auditing publication, durability, node changes, and global delivery.
What to build
- A user can search track, artist, and album metadata and receive relevant paginated results.
- A user can save or remove tracks and create, reorder, and update playlists of up to 10,000 tracks.
- An authenticated and entitled user can obtain a short-lived authorization to stream a selected track.
- A user can start reliable audio playback and later resume from a recently saved position.
- The platform records deduplicated listening events for one year without blocking playback on analytics processing.
- An authenticated creator can submit an audio source of at most 100 MB, safely check or retry its processing result, and make a ready immutable version playable while pending or rejected versions stay unavailable for playback.
At scale
- For this exercise, assume a global catalog of 100 million tracks.
- For this exercise, assume 10 million concurrent listeners at peak.
- For this exercise, assume playback begins within 300 ms at p95 with 99.99% availability.
- For this exercise, assume each playlist contains at most 10,000 tracks and listening events are retained for one year.