← Yelp Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

Brutal system design round at Yelp for a data scientist role. The scope was enormous and I kept second-guessing my design choices out loud, which probably didn't help.

Questions Asked (7)

Q1

Design a personalized news feed system that supports both push and pull delivery at scale (100M monthly active users, 200k writes per second, 2M reads per second, p99 latency under 200ms).

System DesignTechnical Trade-offs
Author's notes

The scale numbers threw me a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a hybrid architecture that combines push for active users and pull for inactive users, with a fan-out service and caching layer. Emphasize trade-offs between latency, cost, and complexity, and discuss how to handle hot users and celebrity problem.

Pro tip: Quantify the impact of design choices: e.g., 'Using push for all users would require 200k * 100M = 20T writes per second, which is infeasible; hybrid reduces this to manageable levels.' This shows you can reason with numbers.

1. Clarify Requirements and Scale

Confirm functional and non-functional requirements: 100M MAU, 200k writes/s, 2M reads/s, p99 <200ms. Ask about content types, personalization, and delivery guarantees.

2. High-Level Architecture

Propose a hybrid push-pull model: push for active users (e.g., last 24h) and pull for others. Include components: ingestion, fan-out service, feed cache, and ranking service.

3. Deep Dive into Components

Detail fan-out service (e.g., using Kafka and workers), feed storage (e.g., Redis for push, Cassandra for pull), and ranking (ML models for personalization). Address hot users and celebrity problem.

4. Scalability and Latency

Explain how to achieve 2M reads/s with <200ms latency: use caching, CDN, read replicas, and precomputed feeds. Discuss sharding and partitioning strategies.

5. Trade-offs and Monitoring

Discuss trade-offs: push vs pull (latency vs cost), consistency vs availability. Mention monitoring, A/B testing, and fallback mechanisms.

Key Points to Mention

  • Hybrid push-pull model to balance latency and cost
  • Fan-out service using message queues (e.g., Kafka) for asynchronous processing
  • Caching strategies (Redis, Memcached) and CDN for low-latency reads
  • Celebrity problem: special handling for high-follower users (e.g., pull-based for their posts)
  • Personalization: ranking algorithms (collaborative filtering, embeddings) and real-time features
  • Scalability: sharding, replication, and auto-scaling to handle peak loads

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

Q2

How would you handle fan-out-on-write versus fan-out-on-read for a feed system, and what drives that decision?

Technical Trade-offsSystem Design
Author's notes

This is where I felt most comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining fan-out-on-write and fan-out-on-read, then compare their trade-offs in terms of latency, cost, and complexity. Explain that the decision depends on factors like read/write ratio, user activity patterns, and consistency requirements, and give a concrete example from a Yelp-like feed (e.g., business updates or reviews).

Pro tip: Emphasize that the choice is not binary; hybrid approaches (e.g., fan-out-on-write for active users, fan-out-on-read for inactive) are common in production systems. Also, mention that data scientists should consider how the choice impacts feature freshness and model training pipelines.

1. Define the two approaches

Clearly explain fan-out-on-write (pre-compute feeds on write) and fan-out-on-read (compute feeds on read), including their basic mechanics.

2. Compare trade-offs

Discuss latency, throughput, storage cost, and complexity for each approach, highlighting when each excels (e.g., write-heavy vs read-heavy).

3. Identify decision drivers

List key factors that influence the choice: read/write ratio, user base size, activity distribution, consistency needs, and cost constraints.

4. Apply to Yelp context

Relate the decision to Yelp's feed (e.g., business updates, reviews, photos) and typical user behavior (many reads, fewer writes, power users).

5. Propose a hybrid or adaptive solution

Suggest a hybrid approach that balances trade-offs, such as fan-out-on-write for active users and fan-out-on-read for others, and mention monitoring and iteration.

Key Points to Mention

  • Read/write ratio and its impact on system load
  • Latency requirements for feed generation
  • Storage and compute cost trade-offs
  • Scalability with number of users and follow relationships
  • Consistency and freshness of feed content
  • Hybrid approaches and adaptive strategies based on user activity

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

Q3

Walk through the external API design for this system, including endpoints for publishing, subscribing, retrieving a feed with pagination, acknowledging consumption, retracting content, and logging feedback. Include request/response schemas and explain how you'd handle idempotency.

API & IntegrationsSystem Design
Author's notes

Blanked on idempotency for the retract endpoint specifically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's purpose and key requirements, then outline the API endpoints with their HTTP methods and schemas, and finally discuss idempotency strategies. Emphasize how the design supports data science use cases like feedback loops and content lifecycle management.

Pro tip: For a data science role, highlight how the API design enables experimentation and model improvement by ensuring reliable data collection and idempotent operations. Mention that idempotency keys should be generated client-side and stored server-side with a TTL to prevent replay attacks.

1. Clarify Requirements and Scope

Ask clarifying questions about the system's scale, expected clients, and data science needs. Define the core operations: publish, subscribe, feed retrieval, acknowledge, retract, and feedback logging.

2. Design Endpoints and Schemas

For each operation, specify the HTTP method, path, request/response JSON schemas, and status codes. Ensure consistency in naming and error handling.

3. Explain Idempotency Handling

Describe how to make operations idempotent, especially for publish, acknowledge, retract, and feedback. Use idempotency keys for POST/PUT requests and ensure GET/DELETE are naturally idempotent.

4. Address Pagination and Feed Retrieval

Detail the pagination strategy (e.g., cursor-based) for the feed endpoint, including parameters and response metadata. Discuss how to handle large feeds and ordering.

5. Discuss Data Science Implications

Explain how the API design supports data collection for model training, A/B testing, and feedback loops. Mention logging, monitoring, and analytics integration.

Key Points to Mention

  • Use RESTful principles with clear resource naming and HTTP methods.
  • Include idempotency keys in headers for non-idempotent operations (e.g., POST) and store them with a TTL.
  • For feed pagination, use cursor-based pagination with a 'next_cursor' token to ensure consistency.
  • Acknowledge consumption via a POST to /acknowledge with message IDs, ensuring idempotency by tracking acknowledged IDs.
  • Retraction should be a DELETE or POST to /retract with content ID, and should be idempotent.
  • Feedback logging should accept structured data (e.g., rating, comments) and be idempotent using a unique feedback ID.
  • Consider rate limiting, authentication, and versioning for production readiness.

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

Q4

How would you implement deduplication, content diversity, freshness constraints, and daily notification caps in a feed ranking system?

System DesignProduct Sense & Ideation
Author's notes

Scattered answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the product goals and constraints, then propose a modular ranking pipeline where each constraint is a post-processing layer after the core relevance model. Explain how you would implement each layer (deduplication, diversity, freshness, caps) with specific algorithms and metrics, and discuss trade-offs and evaluation.

Pro tip: Emphasize that constraints should be applied as soft penalties or hard filters depending on business impact, and always A/B test their effect on long-term user engagement and retention, not just immediate CTR.

1. Clarify Requirements and Goals

Ask about the feed's purpose (e.g., home feed, search), user expectations, and business metrics (e.g., engagement, retention). Define what 'deduplication', 'diversity', 'freshness', and 'caps' mean in this context.

2. Design Core Ranking Model

Outline a relevance model (e.g., learning-to-rank) that scores items based on user-item affinity. This serves as the base ranking before applying constraints.

3. Implement Constraint Layers

Describe each constraint as a post-processing step: deduplication (e.g., by business ID or content similarity), diversity (e.g., MMR or category quotas), freshness (e.g., time decay or hard recency filter), and daily caps (e.g., per-user per-category limits).

4. Handle Trade-offs and Interactions

Discuss how constraints interact (e.g., diversity may reduce freshness) and propose a unified optimization (e.g., constrained optimization or re-ranking with penalties).

5. Evaluate and Iterate

Define offline metrics (e.g., diversity, freshness, cap violation rate) and online A/B tests (e.g., CTR, session length, retention). Monitor for unintended consequences and iterate.

Key Points to Mention

  • Deduplication: exact match (e.g., same business ID) and near-duplicate detection (e.g., MinHash, SimHash, or embeddings).
  • Diversity: intra-list similarity reduction (e.g., MMR), category/geo diversity, and calibration across user segments.
  • Freshness: time decay functions (e.g., exponential), hard filters for recency, and balancing with relevance.
  • Daily caps: per-user limits on notifications or feed items per category/day, with graceful degradation and prioritization.
  • Evaluation: offline metrics (e.g., diversity score, freshness ratio, cap violation rate) and online A/B tests with guardrail metrics.
  • Scalability: efficient implementation (e.g., streaming, caching) and real-time constraints.

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

Q5

Describe how you would build the ranking feature pipeline and serve online inference at low latency for a personalized feed.

System DesignData Modeling
Author's notes

Talked through a two-stage setup: candidate retrieval then a reranker.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: define the ranking objective, latency SLA, scale, and available data. Then walk through the end-to-end pipeline: data collection, feature engineering, model training, and online serving with low latency. Emphasize trade-offs between model complexity and latency, and how you would monitor and iterate.

Pro tip: Focus on the feature store and caching strategy—these are critical for low-latency serving and often overlooked. Also, mention how you would handle cold-start and ensure consistency between offline and online features.

1. Clarify Requirements and Constraints

Ask about the business goal (e.g., increase user engagement), latency SLA (e.g., <100ms), scale (QPS, number of users/items), and available data (user interactions, item metadata).

2. Design the Offline Pipeline

Outline data ingestion, feature engineering (user, item, context features), and model training (e.g., gradient boosted trees or neural networks). Include offline evaluation and A/B testing.

3. Build the Online Serving Architecture

Describe how to serve features and model predictions in real-time: use a feature store for low-latency feature retrieval, cache precomputed features, and deploy the model as a microservice with efficient inference (e.g., ONNX, TensorFlow Serving).

4. Optimize for Low Latency

Discuss techniques like model quantization, pruning, batching, and asynchronous feature fetching. Consider precomputing rankings for common queries and using a two-stage ranking (candidate generation + ranking).

5. Monitor and Iterate

Set up monitoring for latency, throughput, and model performance (e.g., click-through rate). Plan for retraining, A/B testing, and handling feedback loops.

Key Points to Mention

  • Feature store (e.g., Feast, Tecton) for consistent online/offline features
  • Low-latency serving techniques: caching, model optimization, and efficient infrastructure
  • Two-stage ranking: candidate generation then ranking to reduce latency
  • Handling cold-start and ensuring feature freshness
  • Monitoring and A/B testing for continuous improvement
  • Trade-offs between model complexity and latency

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

Q6

How would you run online experiments on feed ranking while maintaining user-level traffic consistency and ensuring safe rollouts?

A/B Testing & ExperimentationSystem Design
Author's notes

This one I actually liked.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the importance of user-level randomization and consistent hashing to ensure each user sees a consistent ranking variant across sessions. Then outline a safe rollout strategy using staged deployment, guardrail metrics, and automated rollback. Finally, discuss how to measure the experiment's impact on feed ranking while accounting for network effects and long-term effects.

Pro tip: Emphasize the need for a pre-experiment power analysis and a clear definition of guardrail metrics to detect unintended consequences early. Also, mention that you would monitor for novelty effects and use holdout groups for long-term measurement.

1. Define Experiment Goals and Metrics

Clearly define the primary metric (e.g., engagement, CTR) and guardrail metrics (e.g., user satisfaction, latency). Ensure alignment with business objectives.

2. Design Randomization and Traffic Consistency

Use user-level randomization with consistent hashing to assign users to variants. Ensure the same user sees the same variant across devices and sessions.

3. Implement Safe Rollout

Start with a small percentage of traffic (e.g., 1-5%) and gradually increase. Set up automated monitoring and rollback triggers based on guardrail metrics.

4. Analyze Results and Iterate

After sufficient sample size, analyze results using appropriate statistical methods. Check for heterogeneous treatment effects and long-term impact.

Key Points to Mention

  • User-level randomization and consistent hashing to avoid interference between variants.
  • Staged rollout with canary deployment and automated rollback based on guardrail metrics.
  • Guardrail metrics such as latency, error rates, and user satisfaction to ensure safe rollout.
  • Power analysis to determine sample size and experiment duration.
  • Handling network effects and interference in feed ranking experiments.
  • Long-term holdout groups to measure sustained impact and novelty effects.

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

Q7

How would you handle GDPR deletion requests, multi-region replication, abuse and spam controls, and failure modes like partial regional outages in this system?

System DesignTechnical Trade-offs
Author's notes

Ran out of steam here near the end.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's scope and data flows, then address each concern (GDPR, replication, abuse, outages) with a balanced view of trade-offs between consistency, availability, and cost. Emphasize a data science perspective: how these factors affect model training, feature freshness, and evaluation, and propose monitoring and fallback strategies.

Pro tip: Frame GDPR deletion as a data lineage and provenance challenge—show you understand that deleting a user's data must cascade through derived datasets, features, and models, which is often overlooked. Also, highlight that abuse controls can introduce bias into training data, so you need to monitor for feedback loops.

1. Clarify requirements and constraints

Ask about data volume, latency requirements, regional regulations, and SLAs to scope the problem. Identify which data is personal vs. derived, and what consistency guarantees are needed.

2. Design for GDPR deletion

Propose a deletion pipeline that propagates through all replicas and derived datasets (features, models) using techniques like tombstoning, crypto-shredding, or periodic re-training. Discuss trade-offs between immediate deletion and eventual consistency.

3. Handle multi-region replication and abuse controls

Choose a replication strategy (e.g., active-active, active-passive) based on consistency needs. For abuse/spam, describe a layered approach: rate limiting, anomaly detection, and manual review, and how to integrate with replication (e.g., region-specific rules).

4. Address failure modes and partial outages

Design for graceful degradation: fallback to stale data, queue writes for later, or route to healthy regions. Discuss how to detect and recover from partial outages, and the impact on model training and serving.

5. Summarize trade-offs and monitoring

Recap key trade-offs (consistency vs. availability, cost vs. compliance) and propose monitoring for deletion SLAs, replication lag, abuse rates, and outage recovery. Tie back to data science implications like model drift.

Key Points to Mention

  • GDPR right to erasure: need for data lineage tracking and deletion propagation to derived data (features, models).
  • Multi-region replication strategies: synchronous vs. asynchronous, and their impact on consistency and latency.
  • Abuse and spam controls: rate limiting, anomaly detection, and the risk of feedback loops in training data.
  • Failure modes: partial regional outages, graceful degradation, and fallback mechanisms (e.g., stale reads, write queuing).
  • Trade-offs: consistency vs. availability (CAP theorem), cost vs. compliance, and latency vs. accuracy.
  • Monitoring and observability: metrics for deletion compliance, replication lag, abuse detection, and outage recovery.

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