Trees & Tries
Trees and tries are the tree-shaped corner of Spotify's coding surface, and the two traversals behind them, DFS and BFS, recur across the whole loop. Spotify tends to frame them in product language: walk a playlist-folder hierarchy, follow user-to-content links, find a path in the artist graph. The trie shows up somewhere more specific, the search box that completes a track or podcast name as you type. Underneath both sits standard binary-tree and prefix-tree material, run live on CoderPad and tested against real inputs.
Treat this cluster honestly. There is no signature algorithm here. Trees are a smaller slice of the loop than the hashing and sliding-window clusters. What you get is the usual tree-and-trie spine pointed at Spotify's product surfaces: Max Depth shows up as folder depth, autocomplete as the search bar. The actual work is narrow. Drill the two templates that fold almost every problem in this space into a few lines. Then prove them on one tree problem and one trie problem you can run and narrate.
SpotifyPremium lesson · Coding round
The 2 Spotify problems are below.
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
Each with hints, the follow-up and a tested solution.
Get the Spotify questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
Spotify interview guideKnow what Spotify asks before you walk in.
11 coding · 5 system design · 23 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.