Design a restaurant recommender under constraints
Company: Meta
Role: Data Scientist
Category: Machine Learning
Difficulty: hard
Interview Round: Onsite
Build a restaurant recommendation system for a food delivery app. Constraints: return top-20 within 5 miles in <100 ms p99; most users have only implicit feedback (clicks, orders, dwell); strong cold-start for new restaurants.
(a) Propose a two-stage architecture (candidate generation + ranking). Specify model families for each stage (e.g., matrix factorization or two-tower for retrieval; gradient-boosted trees or deep ranking for scoring), key features (user cuisine/price preferences, time-of-day, location distance, popularity priors, recency decay), and how to incorporate textual/menu embeddings.
(b) Detail cold-start strategies for new restaurants and new users (content-based embeddings, hierarchical priors by cuisine/price/chain, exploration via contextual bandits or Thompson sampling) while controlling business constraints like diversity, fairness, and budget caps.
(c) Describe offline metrics (NDCG@K, MAP@K, coverage, diversity) and online metrics (CTR, order conversion, AOV), and how you would calibrate scores and prevent leakage (e.g., using time-based splits and delayed labels).
(d) Explain how you’d implement approximate nearest neighbor search for retrieval (index type, embedding dimension, refresh cadence), caching strategies by geo/time-of-day, and feature stores to meet latency and freshness requirements.
(e) Provide a brief pseudocode sketch for re-ranking that enforces distance and diversity constraints while maximizing predicted utility.
Quick Answer: This question evaluates a candidate's competency in designing scalable machine learning recommender systems, covering retrieval and ranking architectures, cold-start strategies, evaluation metrics and hygiene, and latency/freshness engineering.