Design product recommendations like Amazon
PremiumML systemEasy
- Item to item collaborative filtering
- Co occurrence
- Position bias
Quick answer
This ML system interview question asks you to design product recommendations like Amazon. Aim for a design that turns data into useful predictions in production, then explain the data, training, serving and monitoring. Interviewers want to see how you frame the problem, measure success and keep the model healthy after launch.
The problem
Design product recommendations like Amazon's "Customers who bought this also bought" carousel: for any product page, show 10 related products the shopper is likely to add to the cart. The hard parts are popular items that co-occur with everything, new products with no history, and labels that only exist for what was shown.
The carousel sits under the product details. It is the same for every shopper on a given product page, apart from filtering out items the shopper already bought or that are out of stock. It is a good place to start because it needs no user model, only relations between items.
What must the system do?
- Related items: For each product, show 10 products that shoppers often buy with it or instead of it.
- Filters: Never show out-of-stock items, the product itself or items the shopper already bought (except consumables such as batteries).
How well must it do it?
- Fast: The carousel adds no more than 50 ms p99 to the product page.
- Relevant: Beat the "best sellers in the same category" list on add-to-cart rate in an A/B test.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Item to item collaborative filtering
- Co occurrence
- Position bias
- Cold start
- NDCG
- Precomputed recommendations
How you’ll practise
- Problem framing
- Data and labels
- Features and model
- Training and evaluation
- Serving and monitoring
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any ML system design round.
- Frames the product goal as a clear ML problem
- Defines offline and online success metrics
- Explains where the data and labels come from
- Separates training from serving and keeps features consistent
- Plans for drift, retraining and rollbacks
- Weighs model quality against latency and cost
Questions people ask about this interview question
- Which design type is this question?
- It is an ML system question. You design product recommendations like Amazon and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Easy, so it suits engineers who are new to ML system interviews. It is also a good warm-up before harder questions.
- What should I cover first?
- Start with the product goal, how success is measured and what data is available. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team