← DoorDash Interview Insights

DoorDash·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

System design round at DoorDash for a software engineer role. The whole session was built around designing a rating and review system for a food delivery marketplace, end to end, with a bunch of follow-ups on consistency, hotspot handling, and payment idempotency.

Questions Asked (5)

Q1

Design a rating and review system for a food delivery marketplace. Users can rate items, view average ratings, sort reviews by recency or helpfulness, and upvote/downvote reviews. The system should also handle an automatic monetary reward when a review gets enough positive engagement.

System DesignData ModelingTechnical Trade-offs
Author's notes

This was the main question and it took the full session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements, then design the data model and APIs for ratings, reviews, and voting. Discuss trade-offs in storage, consistency, and scalability, and detail the reward mechanism with idempotency and fraud prevention.

Pro tip: Emphasize idempotency and exactly-once processing for rewards to avoid duplicate payouts, and consider using a ledger system for financial transactions. Also, discuss how to handle vote manipulation and ensure fairness in helpfulness sorting.

1. Clarify Requirements and Scale

Ask about expected traffic, read/write ratios, consistency needs, and reward criteria. Define functional requirements: users can rate items (1-5 stars), write reviews, view average ratings, sort by recency/helpfulness, and upvote/downvote reviews.

2. Design Data Model and Storage

Choose a database (e.g., SQL for transactions, NoSQL for scale) and design schemas for users, items, reviews, votes, and rewards. Consider denormalization for average ratings and helpfulness scores to optimize reads.

3. Define APIs and Sorting Logic

Design RESTful or GraphQL endpoints for submitting reviews, voting, and fetching sorted reviews. Explain how to compute helpfulness (e.g., Wilson score) and handle pagination for large datasets.

4. Implement Reward Mechanism

Detail how to trigger rewards when a review reaches a threshold of net upvotes. Use a message queue and idempotent consumer to process reward events, and integrate with a payment system via a ledger.

5. Address Scalability and Trade-offs

Discuss caching strategies (e.g., Redis for average ratings), sharding, and consistency models. Trade-offs: strong vs. eventual consistency for votes, real-time vs. batch reward processing, and fraud detection.

Key Points to Mention

  • Idempotency and exactly-once processing for reward payouts to prevent duplicates.
  • Use of a ledger system for financial transactions and auditability.
  • Helpfulness score calculation (e.g., Wilson score) to sort reviews fairly.
  • Caching strategies for average ratings and review counts to reduce database load.
  • Handling vote manipulation and fraud detection (e.g., rate limiting, anomaly detection).
  • Trade-offs between SQL and NoSQL databases for different components.

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

Q2

A few reviews go viral and get a huge spike in votes. How do you prevent the vote counter from becoming a write hotspot while still enforcing one vote per user?

System DesignTechnical Trade-offsData Modeling
Author's notes

My first instinct was sharding the counter across multiple rows and summing them, which is fine, but I didn't immediately connect that the uniqueness constraint still lives on the canonical votes table separate from the counter.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and scale, then propose a sharded counter design that distributes writes across multiple nodes while enforcing one vote per user via a separate unique constraint. Discuss trade-offs between consistency, latency, and complexity, and how to handle hot shards and eventual consistency.

Pro tip: Mention that you can use a combination of sharding and asynchronous aggregation to handle spikes, but ensure idempotency and deduplication to enforce one vote per user. Also, consider using a write-optimized store like Cassandra with a unique key on (user_id, review_id) to prevent duplicate votes.

1. Clarify requirements and constraints

Ask about the expected scale, read/write patterns, latency requirements, and consistency needs. Confirm that one vote per user is a hard constraint and that the vote count can be eventually consistent.

2. Design a sharded counter

Propose splitting the vote counter into N shards (e.g., by review_id + shard_id) to distribute writes. Each vote increments a random shard, and reads sum all shards. This reduces contention on a single key.

3. Enforce one vote per user

Use a separate store (e.g., a database with a unique constraint on (user_id, review_id)) to record votes. This can be done asynchronously or transactionally, but must be idempotent to handle retries.

4. Handle hot shards and spikes

If a review goes viral, shards may still become hot. Consider dynamic sharding, write buffering (e.g., in-memory aggregation with periodic flush), or using a distributed queue to smooth spikes.

5. Discuss trade-offs and optimizations

Talk about consistency vs. latency (e.g., eventual consistency for counts), read amplification (summing shards), and potential use of caching or materialized views for reads. Mention monitoring and auto-scaling.

Key Points to Mention

  • Sharding the counter to distribute writes across multiple nodes
  • Using a unique constraint on (user_id, review_id) to enforce one vote per user
  • Idempotency and deduplication to handle retries and ensure exactly-once semantics
  • Trade-offs between strong and eventual consistency for vote counts
  • Handling hot shards with dynamic sharding or write buffering
  • Read optimization by caching aggregated counts or using materialized views

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

Q3

A bug caused vote counts to be double-counted for about an hour. How do you detect the drift and fix the aggregates without taking the system offline?

Root Cause AnalysisSystem Design
Author's notes

Liked this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how you would detect the drift through monitoring and reconciliation, then describe a safe, incremental fix that avoids downtime. Emphasize idempotent corrections, validation, and communication with stakeholders.

Pro tip: Mention using a shadow table or dual-write with reconciliation to validate fixes before applying them to production, and always have a rollback plan.

1. Detect the Drift

Use monitoring alerts, anomaly detection, or reconciliation jobs to identify discrepancies between source events and aggregates. Check logs for the bug's time window.

2. Assess Impact

Quantify the scope: which aggregates are affected, how many records, and the magnitude of overcounting. Determine if the bug is still active.

3. Design a Safe Fix

Plan an idempotent correction: recompute aggregates from raw events or apply compensating adjustments. Use a shadow table or batch process to avoid locking.

4. Apply Fix Incrementally

Deploy the fix in small batches, monitor for errors, and validate each batch before proceeding. Use feature flags or canary releases if possible.

5. Validate and Monitor

After correction, run reconciliation checks to ensure aggregates match expected values. Set up alerts for future drifts and document the incident.

Key Points to Mention

  • Idempotent correction to avoid double-fixing
  • Reconciliation between raw events and aggregates
  • Batch processing to minimize impact
  • Monitoring and alerting for future anomalies
  • Communication with stakeholders during the fix
  • Post-mortem and preventive measures

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

Q4

The payment service times out after you've already inserted the reward record in your database. You don't know if the credit was actually issued. How do you guarantee the author gets paid exactly once?

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

Two separate problems and I conflated them at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the distributed transaction problem and the need for exactly-once semantics. Propose using idempotency keys and a state machine to track payment status, with reconciliation to handle unknown outcomes. Emphasize that true exactly-once requires idempotent operations and a reliable way to resolve in-flight transactions.

Pro tip: Mention that exactly-once is achieved through at-least-once delivery plus idempotent processing, and that the payment provider's API often supports idempotency keys to deduplicate requests.

1. Identify the core challenge

Recognize that the timeout creates an unknown state: the payment may or may not have been processed. This is a classic distributed transaction problem requiring coordination between the database and external payment service.

2. Design for idempotency

Use a unique idempotency key for each payment attempt, generated before the first call. Ensure the payment provider supports idempotency so retries with the same key don't double-charge.

3. Implement a state machine

Track payment status in your database (e.g., PENDING, COMPLETED, FAILED). On timeout, mark as PENDING and trigger a reconciliation process to query the payment provider for the final status.

4. Reconciliation and retry logic

Periodically reconcile pending payments by querying the provider using the idempotency key. If the payment succeeded, update the record; if not, safely retry or fail.

5. Ensure atomicity and consistency

Use database transactions to update the reward record and payment status together. Consider outbox pattern or event sourcing to reliably publish events and avoid inconsistencies.

Key Points to Mention

  • Idempotency keys to deduplicate payment requests
  • State machine for payment lifecycle (PENDING, COMPLETED, FAILED)
  • Reconciliation process to resolve unknown states
  • At-least-once delivery with idempotent processing equals exactly-once
  • Database transactions and outbox pattern for consistency
  • Payment provider's API capabilities (e.g., idempotency support, status query)

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

Q5

Product wants reviews sortable by a 'helpfulness' score that blends vote counts, recency, and reviewer reputation. How does that change your read model and indexes?

System DesignData ModelingTechnical Trade-offs
Author's notes

Honestly the question I was least prepared for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: how the helpfulness score is computed, how often it updates, and the read patterns (e.g., sorting by score, filtering by product). Then propose a denormalized read model that stores the precomputed score and supports efficient sorting, and discuss indexing strategies to handle the access patterns. Finally, address trade-offs like staleness, write amplification, and scalability.

Pro tip: Mention that you'd precompute the helpfulness score asynchronously and store it in a dedicated read store (like a search index or a materialized view) to avoid expensive on-the-fly calculations, and use a composite index that includes the score and other common filters to optimize query performance.

1. Clarify requirements and access patterns

Ask about how the helpfulness score is defined, how frequently it changes, and the expected query patterns (e.g., sort by score descending, pagination, filtering by product or category).

2. Design the read model

Propose a denormalized read model that stores the precomputed helpfulness score along with review data, optimized for reads. Consider using a search index (e.g., Elasticsearch) or a materialized view in a database.

3. Define indexing strategy

Suggest indexes that support the main query patterns: a composite index on (product_id, helpfulness_score DESC) for sorting within a product, and possibly additional indexes for other filters. Discuss covering indexes to avoid lookups.

4. Handle score updates and consistency

Explain how the score is updated (e.g., via a batch job or stream processing) and how to propagate changes to the read model. Discuss trade-offs between consistency and latency, and how to handle stale scores.

5. Address scalability and trade-offs

Talk about partitioning/sharding strategies, caching, and the impact on write throughput. Mention alternatives like computing score on the fly for small datasets vs. precomputing for large scale.

Key Points to Mention

  • Denormalization: store precomputed helpfulness score in the read model to avoid expensive joins or calculations at query time.
  • Composite index: create an index on (product_id, helpfulness_score DESC) to efficiently retrieve top reviews per product.
  • Score computation: use a background job or stream processing to update scores asynchronously, ensuring eventual consistency.
  • Trade-offs: discuss staleness vs. freshness, write amplification, and the cost of maintaining indexes.
  • Scalability: consider sharding by product_id or using a distributed search engine like Elasticsearch for horizontal scaling.
  • Caching: cache frequently accessed sorted lists (e.g., top reviews per product) to reduce load on the read store.

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