← Yelp Interview Insights

Yelp·Data Scientist·Onsite - System Design / Architecture·Senior

Senior
Jul 2026

Summary

Yelp DS interview that was basically a full ML systems design gauntlet compressed into one session. They wanted end-to-end depth on a recommender system for a cold-start-heavy content app, and I mean real depth, not just buzzword soup.

Questions Asked (5)

Q1

Design a two-stage recommendation system (candidate generation plus ranking) for a content app with sparse user interactions and frequent new items. Walk through your model choices, loss functions, and negative sampling strategy for each stage.

System DesignTechnical Trade-offs
Author's notes

I led with a two-tower retrieval model for candidate gen because it handles cold-start reasonably well if you lean on item content features instead of pure ID embeddings.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the two-stage architecture and how it addresses sparsity and new items: candidate generation uses content-based embeddings and two-tower models with in-batch negatives, while ranking uses a heavier model with hard negative mining. Emphasize trade-offs between exploration (new items) and exploitation (user history), and how loss functions and negative sampling differ per stage.

Pro tip: Tie your choices to Yelp's context: sparse interactions mean you should lean on content features (e.g., business attributes, reviews) and use session-based or sequential models; for new items, ensure candidate generation includes content-based retrieval and ranking uses feature crosses with item metadata.

1. Clarify requirements and constraints

Ask about scale, latency, and definition of 'sparse' and 'frequent new items'. Confirm whether the app is Yelp-like (local businesses) and what signals are available (text, images, categories).

2. Design candidate generation

Propose a two-tower model with content features for users and items, trained with sampled softmax or in-batch negatives. For new items, include a content-based fallback (e.g., embedding similarity) and use item metadata.

3. Design ranking stage

Use a deeper model (e.g., DLRM, DeepFM) with user-item interaction features and content. Train with binary cross-entropy and hard negative sampling (e.g., items ranked high by candidate generator but not interacted).

4. Address sparsity and new items

For sparsity: use content features, transfer learning, and regularization. For new items: ensure candidate generation includes them via content-based retrieval, and ranking uses item metadata; consider exploration strategies like Thompson sampling.

5. Evaluate and iterate

Define offline metrics (recall@k for candidate generation, NDCG for ranking) and online metrics (CTR, engagement). Discuss A/B testing and how to handle cold-start in evaluation.

Key Points to Mention

  • Two-tower model for candidate generation with in-batch negatives and content features
  • Sampled softmax loss for candidate generation to handle large item catalogs
  • Hard negative mining for ranking to focus on difficult examples
  • Binary cross-entropy loss for ranking with implicit feedback
  • Content-based fallback for new items in candidate generation
  • Exploration vs exploitation trade-off for new items (e.g., epsilon-greedy, Thompson sampling)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle user and item cold-start in both stages of the recommendation pipeline? What specific features would you rely on?

System DesignAdaptability & Ambiguity
Author's notes

New items were the trickier part to articulate.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the two stages of the recommendation pipeline (candidate generation and ranking) and how cold-start affects each. Then, for each stage, describe strategies for user and item cold-start, emphasizing feature engineering and fallback mechanisms. Conclude with how you would evaluate and iterate on these solutions.

Pro tip: At Yelp, emphasize using rich content and context features (e.g., business attributes, user location, query intent) to mitigate cold-start, and mention the importance of exploration (e.g., multi-armed bandits) to gather data quickly.

1. Clarify pipeline stages and cold-start definitions

Briefly define the two stages (e.g., candidate generation and ranking) and distinguish between user and item cold-start. This shows you understand the problem scope.

2. Address candidate generation cold-start

For new users, use popularity, location-based, and context-aware retrieval; for new items, use content-based similarity and attribute matching. Mention fallback to non-personalized candidates.

3. Address ranking cold-start

For new users, rely on contextual features and session-based signals; for new items, use content features and early engagement metrics. Consider a separate model or feature imputation for cold-start cases.

4. Discuss feature engineering and exploration

List specific features (e.g., user demographics, item attributes, cross features) and exploration strategies (e.g., epsilon-greedy, Thompson sampling) to collect data and reduce uncertainty.

5. Evaluate and iterate

Propose metrics (e.g., CTR, conversion, diversity) and A/B testing to measure cold-start performance. Mention the need for continuous monitoring and retraining.

Key Points to Mention

  • Two-stage pipeline: candidate generation and ranking
  • User cold-start: use demographics, location, context, and session features
  • Item cold-start: use content-based features (attributes, text, images) and similarity to existing items
  • Fallback strategies: popularity, trending, or non-personalized recommendations
  • Exploration techniques: multi-armed bandits, epsilon-greedy to gather feedback
  • Evaluation metrics: CTR, conversion, diversity, and A/B testing

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How do you balance exploration and exploitation in this recommendation system? Which specific strategies would you use?

Technical Trade-offsProduct Analytics & Metrics
Author's notes

Thompson sampling was my go-to answer and I felt good about it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the exploration-exploitation trade-off as a business problem specific to Yelp's recommendation context, then describe a systematic approach that includes offline evaluation, online experimentation, and continuous monitoring. Highlight concrete algorithms like multi-armed bandits or Thompson sampling, and explain how you would measure success using both engagement and business metrics.

Pro tip: Emphasize that the optimal balance is dynamic and context-dependent—e.g., exploration is more valuable for new users or cold-start items, while exploitation dominates for established users—and mention the importance of guardrail metrics to prevent degradation of user experience.

1. Define the objective and constraints

Clarify what success means for Yelp's recommendation system (e.g., user engagement, business listings, diversity) and any constraints like latency or fairness. This sets the context for balancing exploration and exploitation.

2. Choose an algorithmic approach

Select a method such as epsilon-greedy, upper confidence bound (UCB), or Thompson sampling, and justify why it fits Yelp's scale and real-time needs. Mention how you would incorporate contextual information (e.g., user location, time of day).

3. Design offline and online evaluation

Describe how you would use historical data for offline simulation (e.g., replay methods) and then run A/B tests or interleaving experiments online to measure the impact of different exploration rates.

4. Monitor and adapt

Explain how you would continuously track key metrics (e.g., click-through rate, conversion, diversity) and adjust the exploration rate based on performance, possibly using automated tuning or reinforcement learning.

5. Address cold-start and long-term value

Discuss strategies for new users or businesses, such as forced exploration or meta-learning, and how to balance short-term engagement with long-term user satisfaction and content freshness.

Key Points to Mention

  • Multi-armed bandits (epsilon-greedy, UCB, Thompson sampling) and contextual bandits
  • Offline evaluation techniques like replay and counterfactual estimation
  • Online experimentation: A/B testing, interleaving, and switchback tests
  • Metrics: CTR, conversion rate, diversity, coverage, and long-term value (LTV)
  • Cold-start problem and dynamic exploration rates based on user/item maturity
  • Guardrail metrics to ensure exploration doesn't harm user experience

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

What offline metrics and online KPIs would you define for this recommender, and how would you design an A/B test that controls for selection bias using inverse propensity scoring or doubly robust estimators?

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

This was the part I actually felt most prepared for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining offline metrics that align with the recommender's objectives, such as precision@k, recall@k, NDCG, and coverage, and online KPIs like CTR, conversion rate, and user engagement. Then, outline an A/B test design that incorporates inverse propensity scoring (IPS) or doubly robust (DR) estimators to correct for selection bias in logged data, ensuring unbiased evaluation of the recommender's impact.

Pro tip: Emphasize that offline metrics are proxies and can be misleading due to bias, so online testing with causal inference methods is crucial. Also, mention that IPS can have high variance, so DR estimators are often preferred for robustness.

1. Define Offline Metrics

Select offline metrics that evaluate ranking quality and coverage, such as NDCG, MAP, precision@k, recall@k, and catalog coverage, ensuring they reflect business goals like relevance and diversity.

2. Define Online KPIs

Choose online KPIs that measure user behavior and business impact, including CTR, conversion rate, session length, retention, and revenue per user, and align them with Yelp's objectives like increasing reviews or bookings.

3. Design A/B Test with Bias Correction

Design an A/B test where users are randomized to control (existing recommender) and treatment (new recommender). To control for selection bias in offline evaluation, use IPS or DR estimators on logged data to simulate an unbiased online experiment.

4. Implement IPS or DR

For IPS, compute propensity scores (probability of item being exposed) and weight logged rewards inversely. For DR, combine IPS with a reward model to reduce variance. Validate estimators using cross-validation or simulation.

5. Analyze and Iterate

Analyze A/B test results using the bias-corrected estimators, check for statistical significance, and iterate on the recommender based on both offline and online metrics.

Key Points to Mention

  • Offline metrics: NDCG, MAP, precision@k, recall@k, coverage, diversity
  • Online KPIs: CTR, conversion rate, engagement, retention, revenue
  • Selection bias in logged data and why it matters
  • Inverse Propensity Scoring (IPS): weighting by inverse propensity
  • Doubly Robust (DR) estimators: combining IPS with reward model
  • A/B test design: randomization, control/treatment groups, sample size, duration

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you meet strict latency requirements (p50 under 50ms and p99 under 200ms end-to-end) for this recommendation system at inference time?

System DesignTechnical Trade-offs
Author's notes

Talked about precomputing user embeddings into a feature store, using approximate nearest neighbor search for retrieval, and caching top candidates for high-traffic users.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the latency budget and breaking down the end-to-end pipeline into stages (candidate generation, ranking, post-processing) to identify where time is spent. Then propose a two-stage architecture with precomputed embeddings and approximate nearest neighbor search for candidate generation, followed by a lightweight ranking model. Emphasize caching, async logging, and fallback strategies to meet p50 and p99 targets.

Pro tip: Mention that p99 is often dominated by tail events like cold cache misses or network hiccups, so you'd design for graceful degradation (e.g., fallback to popular items) and monitor p99 separately from p50. Also, quantify the trade-off: a 10ms reduction in p99 might require significant infrastructure cost, so you'd prioritize based on business impact.

1. Clarify requirements and constraints

Ask about the definition of end-to-end (client to server?), traffic volume, and whether the latency targets are for a single request or aggregated. Confirm if p50/p99 are measured at the service level or including network.

2. Break down the latency budget

Allocate time to each stage: feature retrieval, candidate generation, ranking, and post-processing. For example, 10ms for feature fetch, 20ms for ANN search, 15ms for ranking, 5ms for response formatting.

3. Design for low-latency candidate generation

Use precomputed item embeddings and approximate nearest neighbor (ANN) search (e.g., FAISS, ScaNN) to retrieve top-N candidates in <20ms. Cache user embeddings and avoid real-time feature computation where possible.

4. Optimize ranking and post-processing

Use a lightweight ranking model (e.g., gradient boosted trees or small neural net) with precomputed features. Batch requests, use model quantization, and parallelize independent operations. Consider a cascade where a simple model filters before a complex one.

5. Implement caching, fallbacks, and monitoring

Cache frequent requests and precomputed results. Set up fallbacks (e.g., popular items) for when latency exceeds thresholds. Monitor p50/p99 in real-time and use load shedding to protect the system.

Key Points to Mention

  • Two-stage architecture: candidate generation (ANN) + ranking
  • Precomputed embeddings and feature store for low-latency retrieval
  • Approximate nearest neighbor libraries (FAISS, ScaNN, Annoy) and trade-offs (recall vs. speed)
  • Model optimization: quantization, pruning, ONNX runtime, or TensorRT
  • Caching strategies (Redis, CDN) and async logging to avoid blocking
  • Fallback mechanisms and graceful degradation to meet p99
  • Monitoring and load shedding to handle traffic spikes

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.