← Questions
Design an e-commerce recommendation system
0
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI/ML design interview question asked in Amazon's technical phone screen, last asked Sep 2025. It tests recommendations, ranking and feature engineering.
Design the product recommendation system of a very large e-commerce site. It recommends products on the home feed, on product pages ("customers also bought"), in the cart and in email, for hundreds of millions of shoppers and a catalogue of hundreds of millions of products.
Requirements
- Functional: personalised recommendations per surface; fresh signals (what the shopper just viewed) reflected within minutes; cold start for new shoppers and new products; diversity and long-tail coverage; business rules (in stock, not already bought, sponsored slots).
- Non-functional: well under 100 ms per request at peak; high availability with a fallback when models fail; success measured by click-through, conversion, revenue, diversity and freshness.
Clarifying questions
- Which surface first, and which metric matters most for it?
- How much signal per shopper: views, carts, purchases, searches, ratings?
- What are the latency budget and the peak traffic?
- Are there constraints on fairness to sellers or on sponsored placement?
What a strong answer covers
- Two stages: candidate generation (co-view and co-purchase item graphs, matrix factorisation, a two-tower deep retrieval model with an approximate nearest-neighbour index, sequence models over recent sessions) feeding a ranking model (gradient-boosted trees or a deep network) that scores a few hundred candidates, then re-ranking for diversity and business rules.
- Features from a feature store shared by training and serving: user behaviour, item content and price, context, and cross features; real-time features from a stream.
- Training pipelines (daily retraining, near-real-time updates of embeddings and features) and labels from impressions, clicks and purchases, with position bias corrected.
- Serving: precomputed candidates for heavy surfaces such as email, online ranking for the feed, caching per user and per item, and a popularity fallback.
- Cold start: content features and popularity by category for new items, session-based and demographic signals for new shoppers; bandits for exploration.
- Evaluation: offline recall and NDCG, then A/B tests with guardrails (revenue, return rate, latency); feedback loops, bias, privacy, abuse (fake reviews and clicks), monitoring and rollback.
Follow-ups
- Recommendations get stuck showing the same popular items. How do you fix it?
- A new product launches with no history. How does it get its first impressions?
- How do you measure the long-term effect of recommendations, beyond the next click?
Where it's asked
- Amazon · Technical phone screen · Last asked Sep 202560 min · Live coding in a shared editor that does not run code, plus Leadership Principles questions · No AI
What it tests
recommendations · ranking · feature engineering
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
