Company Interview Questions · Big Tech

Spotify & Netflix: Machine Learning Engineer

❓ 6 questions🏢 Spotify & Netflix🆕 Recent reports

Spotify & Netflix: Machine Learning Engineer Interview Experiences (2025). Rounds, real reported questions and model answers, compiled from public candidate reports (sources at the end). Practice mode hides every answer: say your answer first, press Show answer, then rate yourself. Use 🔁 Review again to build your revision list and 🎲 Random question for a quick drill.

About this interview

Compiled from public candidate reports: Spotify MLE (London, April 2025: levelled from Senior to MLE2; final round of 5 interviews, mostly case studies) and Netflix MLE (United States, January 2025: recruiter call + interview with ML questions and LeetCode-medium coding). The questions are paraphrased, and the model answers are written by EasyLearnSpace.

Spotify Netflix
Role Machine Learning Engineer (MLE2) Machine Learning Engineer
Rounds Recruiter → final loop of 5: 4 case studies + a values interview (little ML theory, one SQL question) Recruiter → interview: general ML + medium coding
Reported questions Backend for an ML recommender; a pipeline ranking the most popular artists per country; forecast monthly active users; recommend one song per user ML fundamentals; LeetCode medium
Outcome Not selected Not selected (no follow-up)

01Rounds at a glance

02Questions and model answers

Q1
Recommend exactly one song per user per day. How would you design it?
  • One slot means very high precision. Optimise for P(listen > 30 s) × P(save/like), with diversity across days.
  • Candidates: collaborative filtering (user–track embeddings), content audio embeddings, the user's recent genres, new releases from followed artists, and exploration.
  • Ranker: a multi-objective model with features such as user taste vectors, time of day, context (workout, commute), track freshness and popularity.
  • Exploration: a bandit (Thompson sampling) to learn from feedback and avoid repetitive picks; never repeat a recently skipped track.
  • Evaluation: offline replay on logged data (counterfactual); online A/B on listen-through, saves and long-term retention.
Q2
Build a data pipeline that ranks the most popular artists in each country daily.
  • Ingest: stream events (play, skip, duration, country, artist_id) → Kafka → a raw table partitioned by date.
  • Daily batch (Spark or SQL):
WITH plays AS (
  SELECT country, artist_id, COUNT(*) AS streams, COUNT(DISTINCT user_id) AS listeners
  FROM play_events
  WHERE event_date = DATE '2025-04-01' AND ms_played >= 30000      -- count qualified streams
  GROUP BY country, artist_id
)
SELECT country, artist_id, streams, listeners,
       RANK() OVER (PARTITION BY country ORDER BY listeners DESC, streams DESC) AS rk
FROM plays QUALIFY rk <= 50;
  • Quality: deduplicate events, filter bots and fraud (stream farming), handle late data, data quality checks (volume anomalies).
  • Serve: write to a table and a cache for the "Top Artists" API; backfill and an idempotent rerun strategy.
Q3
Forecast monthly active users (MAU).
  • Decompose: MAU = retained users + new users + resurrected users, and forecast each with cohort retention curves and acquisition drivers (marketing spend, seasonality, market launches).
  • Models: cohort-based survival curves plus a time-series model (Prophet or ARIMA) for new users; scenario inputs for planned launches.
  • Validate: backtest; provide intervals; explain the drivers to finance and product.
Q4
Design the backend that serves an ML recommendation model.
  • Offline: train embeddings and candidate indexes daily; push to a model registry and an ANN index (e.g. ScaNN/FAISS).
  • Online request: API → fetch user features (feature store) → candidate retrieval (ANN) → ranking model service (batching, GPU or CPU) → business rules → response, all under 100 ms.
  • Caching: precompute recommendations for most users, compute in real time only on context change.
  • Reliability: fallbacks (popular items), timeouts, canaries; logging impressions for training and evaluation.
Q5
Netflix: how do you evaluate a recommender beyond accuracy?
  • Online: long-term engagement (hours viewed, retention, churn reduction), not just clicks.
  • Offline: NDCG and recall, plus diversity, novelty, coverage (long-tail exposure) and calibration to the user's taste mix.
  • Interleaving experiments are more sensitive than A/B for ranking comparisons.
  • Guardrails: no over-concentration on a few titles, fairness to new content.
Q6
Coding (medium): design a hit counter for the last 5 minutes.
from collections import deque
class HitCounter:
    def __init__(self, window=300): self.q, self.w = deque(), window
    def hit(self, t): self.q.append(t)
    def get_hits(self, t):
        while self.q and self.q[0] <= t - self.w: self.q.popleft()
        return len(self.q)
  • For high volume, use 300 buckets of (timestamp, count) in a circular array, which needs O(1) memory per second.

03How to prepare

Sources

Created by Ajeetkumar