Back to Problems
Practice

Design Spotify Top K Songs

Design a system to find the top k heavy hitters in a stream of data. This could be

  • the top k most played songs in a music streaming service like Spotify
  • the top k most viewed videos on a video streaming service like YouTube
  • the top k most bought items in an e-commerce service like Amazon
  • the top k most frequent items in a social media service like Twitter
  • the top k most accessed IP addresses on a network

Functional requirement:

Scale requirement:

  • There are 10 billion song plays per day.
  • There are 100 millions of songs.
  • The top K songs API is accessed 1 million times per day.
  • K is ~100-1000.

Step1
Step2
Step3
Step4
1. Resource Estimation