The Desi Architect
Notes / Design Interview Problems / Design a Recommendation System (Two-Tower, Candidate Gen, Ranking)
Track 5 · Design Interview Problems

Design a Recommendation System (Two-Tower, Candidate Gen, Ranking)

How an e-commerce platform narrows 1 crore products down to 20 personalised items in 47 ms using two-tower vector embeddings, HNSW graph search, dual-tier feature stores, and GPU ranking under a strict latency SLA.

Architectural blueprint for an enterprise recommendation engine serving 5,000 requests a second at p99 under 50 ms. Covers multi-stage funnel candidate retrieval, asymmetric two-tower embeddings, sub-12ms HNSW ANN indexing, online streaming feature stores in Redis, Triton GPU multi-task neural ranking, and MMR diversity re-ranking.

Interview problem44 min read
On this page
  1. Why this problem is hard
  2. What are we building?
  3. Entities, API and numbers
  4. Building it up, one step at a time
  5. Where it gets hard
  6. Failure modes at a glance
  7. The whole picture
  8. How interviewers judge this
  9. Questions that come next
  10. Saying it out loud in 45 minutes
  11. Sources and assumptions