Skip to content

ONE QUESTION. YOUR REASONING.

Design a top songs widget

Design the widget that shows the top K most played songs on Spotify, for the last hour, day and month, and of all time.

System designStreaming and mediaSenior

YOUR BRIEF

What to work through

Work through a top songs widget as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.

  • Return the top K most played items, K up to 1,000
  • Windows: last hour, last day, last month and all time
  • Every play counts toward every window it falls in

BEFORE YOU START

Constraints to discuss

  • A play shows up in the counts within 1 minute
  • Answers in tens of milliseconds
  • Exact counts first; approximate only when the interviewer allows it
  • About 700,000 plays a second at YouTube Shorts scale (Hello Interview)
Need a starting point?

Watch for these common gaps as you prepare:

  • One database write per play with no batching
  • Computing the top K with a scan and sort on every request
  • Ignoring late events at window edges
  • Reaching for a time-series database that cannot handle billions of distinct ids
Read: System design questions and who asks them

Why this question is in the collection

These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.

KEEP GOING

Your next question

Storage, files and linksDesign BitlyInfrastructure and platformDesign a rate limiterInfrastructure and platformDesign an A/B testing platformInfrastructure and platformDesign an ad click aggregator
Browse the collection
01

Pick a question

Read the brief and choose what you want to work on.

02

Talk it through

Explain your thinking. Respond to follow-ups. Draw when a design needs it.

03

Find your next improvement

Use the feedback from your interview to decide what to practise next.