Back to problems

Real-Time Top-K Most Listened Songs Data Structure Design

System Design · ByteDance · Medium

Design and implement a real-time data structure to support the following operations on a massive music streaming platform: play(songId, count) – Records that the song identified by songId has been played count additional times. The count is a positive integer. getTopK(k) – Returns the identifiers of the k songs with the highest total play counts. The result should be ordered from the highest play count to the lowest. The platform handles an enormous user base, with peak…

Checking your access…