Design a nearby places recommendation system
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI/ML design interview question asked in Meta's AI/ML design round, last asked Mar 2026. It tests recommendations, location and ranking.
Design the ML system for a maps or local-discovery product that recommends places a user may want to visit: restaurants, cafes, parks, shops and attractions. Suggestions are personal and depend on the user's history, where they are right now (they may be moving while the app is open), the time of day, their searches and map interactions, popularity and social signals, and the places' own metadata.
Requirements
- Functional: given a user and their current context (location, time, recent activity), return a ranked list of nearby places; refresh as the user moves.
- Functional: handle new users with no history and new places with no interactions.
- Non-functional: low latency on mobile (a few hundred milliseconds end to end); place data that stays fresh (opening hours, closures); coverage across cities and regions, not only dense areas.
Clarifying questions
- What is the surface: a "places near you" feed, search suggestions, or a map layer?
- What counts as success: a tap, a saved place, directions requested, or an actual visit?
- How much history do we have, and is precise location history available with consent?
- Should we predict where a moving user will be, not only where they are now?
- How many places and users, and how dense are the busiest cities?
What a strong answer covers
- Product goals and metrics: online metrics such as visits, directions and saves; offline ranking metrics such as NDCG or recall at k; guardrails for diversity and repeated suggestions.
- Labels: which interactions are positives, how a real visit is inferred, how impressions without a tap become negatives, and how position bias is corrected.
- Features: user history and preferences, distance and travel time, time of day and day of week, place category, ratings, popularity, opening hours, and context from recent searches.
- Two stages: candidate generation by geospatial index (geohash or S2 cells around the current or predicted location) plus embedding retrieval, then a ranking model such as gradient-boosted trees or a deep ranking model.
- Cold start: popularity and category priors for new users, content features and controlled exploration for new places.
- Serving: precomputed user embeddings, cached candidates per cell, real-time context features, and a latency budget per stage.
- Risks: popularity bias and feedback loops, spam and fake reviews, fairness across places and regions, and privacy of location data.
- Experimentation: A/B tests with the primary metric and guardrails, and how to read results when a visit happens hours after the impression.
Follow-ups
- The user is driving at 60 mph. How do candidates and ranking change?
- A new restaurant opens today. How does it get its first impressions without hurting quality?
- How do you keep the system from always recommending the same chain stores?
- Offline NDCG improved but visits went down in the A/B test. What do you check?
Where it's asked
- Meta · AI/ML design · Last asked Mar 2026ML system design
What it tests
recommendations · location · ranking
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.
