Mid-level interview questionAsked at Spotify · interview write-up
Design a real-time system that picks and orders a personalized 10-track playlist from 10,000 candidates, with sequence-aware reranking and diversity constraints.
Model answer
Score all 10,000 candidates with a fast pointwise model of user, context and track, keep the top hundred or so. Then build the list slot by slot: a sequence-aware model scores the remaining tracks given the ones already chosen, for flow in tempo, energy and genre.
Apply diversity constraints greedily, MMR-style, such as at most two tracks per artist. Evaluate offline on skips and completions, then A/B test listening time and skip rate.
Practise the rest
40 ML system design questions, 492 in all, each with a model answer. Free.
More from Spotify interview questions.
More ML system design interview questions
- You need to copy 500 GB of weights to 1,000 GPU workers over shared 10 Gbps links. What's the lower bound on time, and what would you build?
- Design an LLM coding assistant end to end: data, model and evaluation.
- Design a job scheduler for ML training and batch inference on a shared GPU cluster.
- Training a retrieval model over a catalogue of millions of items, you use sampled softmax. Why does it need a correction, and how do you choose the classification loss?
- Design an inference API that converts PDFs into Markdown using several models in stages.
- How can LLMs be incorporated into recommendation systems, from metadata enrichment and cold start to generative retrieval and semantic reranking?