Design Real-Time Session-Based Recommendations for the Shopping App
Last updated: November 29, 2026
Quick Overview
Design a recommendation system for the Amazon shopping app home and detail pages that reacts within seconds to what a customer is browsing in the current session, including signed-out and new customers with no history.
Amazon
November 29, 20260
0
0 solved
Design a recommendation system for the Amazon shopping app home and detail pages that reacts within seconds to what a customer is browsing in the current session, including signed-out and new customers with no history.
A hard ML system design round in the style of Amazon retail personalization teams. The interviewer is probing whether you can move from nightly batch recommendations to streaming features and sequence models while keeping latency, cost and freshness under control.
What the Interviewer Expects
- Separates long-term and in-session intent signals
- Designs a streaming feature pipeline with second-level freshness
- Uses a sequence model for in-session retrieval
- Handles signed-out and cold-start customers
- Keeps p99 latency within page budgets
- Defines evaluation for session-level outcomes
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How do you keep the session state consistent across app and web?
- When should the session signal override long-term history?
- How would you avoid recommending the item the customer just bought?
- How do you test a model whose value depends on freshness?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
M
- Surfaces: home page widgets and detail page carousels.
- Update within about 2 seconds of a click, search or add-to-cart.
- Work for signed-out sessions using a device or session ID.
- Latency budge...
L
- Event stream: clicks, searches, add-to-carts and purchases go to a Kinesis stream keyed by session.
- Session state service: a stream processor (Flink) keeps the last 50 events per session...