Design personalized restaurant search and recommendations
DoorDashMachine Learning Engineer · Technical ScreenLast updated
This question tests the ability to design an end-to-end personalized restaurant recommendation system, covering feature engineering, retrieval-ranking architecture, and infrastructure trade-offs.
Scenario
Design a personalized restaurant recommendation service for a food delivery platform. When a user opens the app, they should see a list of restaurants tailored to their current context, location, and past preferences.
Requirements
- Functional: Support real-time ranking based on user context (location, time, past orders). Support search queries that combine semantic intent with location constraints.
- Non-functional: Latency must be under 200ms for the recommendation feed. Handle high concurrency during peak dining hours. System must be scalable to millions of users.
Your Design Should Cover:
- Data Model: What entities (User, Restaurant, Order, Context) are stored and how are they retrieved?
- Architecture: Describe the retrieval-ranking pipeline. How do you handle candidate generation versus the final ranking model?
- ML Strategy: What features are used? How do you update the model online vs. offline? Where can an LLM/semantic search add value compared to traditional collaborative filtering?
- Trade-offs: Discuss the balance between latency and model complexity (e.g., how to handle re-ranking at scale).
- Evaluation: How do you measure the success of the recommendations (online vs. offline metrics)?
Hints
Hint 1
Consider a two-stage architecture where candidate generation retrieves hundreds of restaurants from a candidate pool and a ranking model scores the top few.
Hint 2
Think about using vector databases for semantic search to handle natural language queries like 'spicy Thai food near me'.
Hint 3
Address the cold-start problem for new restaurants or users by discussing content-based features versus interaction-based collaborative filtering.
Follow-up questions
- How would you ensure the feed remains diverse and avoids 'filter bubbles' where users only see one type of cuisine?
- If you deploy a new model, how would you implement a canary rollout or A/B test to measure its impact without breaking the user experience?
- How would the system design change if we needed to incorporate real-time inventory updates or temporary restaurant closures due to high order volume?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.