Skip to content
RED SAGSkills
hardMachine Learning Engineer interview question

Design a recommendation system for an e-commerce home page with 10 million products and 50 million users.

What the interviewer wants to hear

  • Multi-stage design: candidate generation then ranking then re-ranking
  • Two-tower embeddings and ANN search for retrieval
  • Ranking model with rich features, trained on engagement and conversions
  • Cold start, diversity and business rules
  • Offline metrics plus online A/B tests; latency budget

Model answer

I would use a multi-stage system. First, candidate generation picks a few hundred products from 10 million within tens of milliseconds. A two-tower model learns user and product embeddings, and I retrieve neighbours with an approximate nearest neighbour index, alongside simple sources like trending items and recently viewed categories. Second, a ranking model, such as gradient boosting or a deep model, scores candidates using user history, product features, price, context and cross features, trained on clicks and purchases with weights favouring conversions. Third, re-ranking adds diversity, removes out-of-stock items and applies business rules. For cold start I use content features and popularity for new products and new users. Features come from a feature store to avoid skew. I evaluate offline with recall and NDCG, but trust online A/B tests on conversion and revenue, keeping the total latency under around 150 milliseconds.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Machine Learning Engineer questions