← DoorDash Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at DoorDash for a software engineer role. The prompt was a dual-surface design covering a read-heavy food item detail page and a month-end driver payout pipeline, and the contrast between those two surfaces was basically the whole point of the exercise.

Questions Asked (9)

Q1

Design the backend for a food delivery marketplace covering two surfaces: a customer-facing food item detail page with ratings, posts, and likes, and a monthly driver settlement and payout pipeline.

System DesignTechnical Trade-offs
Author's notes

This is a single prompt but it's really two different problems stapled together, and the interviewers clearly care that you notice the tension.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale for both surfaces, then design each independently before discussing integration points. For the food item detail page, focus on read-heavy optimization with caching and denormalization; for the settlement pipeline, emphasize correctness, idempotency, and batch processing. Conclude by discussing trade-offs and how you would validate the design.

Pro tip: Explicitly call out the tension between consistency and availability in the settlement pipeline—drivers care about accurate payouts, so favor strong consistency and idempotent operations over eventual consistency. Also, mention how you would handle late-arriving events (e.g., a delivery completed after the monthly cutoff) to show you understand real-world edge cases.

1. Clarify Requirements and Scale

Ask about expected QPS, data volume, latency requirements, and consistency needs for each surface. Confirm functional requirements like what data appears on the food item page and how settlements are calculated.

2. Design the Food Item Detail Page Backend

Propose a read-optimized architecture: a primary datastore (e.g., PostgreSQL) for food items, a separate store for user-generated content (posts, likes, ratings), and a caching layer (e.g., Redis) for hot items. Discuss denormalization and precomputed aggregates for ratings.

3. Design the Driver Settlement and Payout Pipeline

Outline a batch-oriented pipeline: ingest delivery events into a message queue (e.g., Kafka), process them in a stream or batch job to compute earnings, store settlement records in a transactional database, and trigger payouts via a payment provider. Emphasize idempotency and exactly-once processing.

4. Address Cross-Cutting Concerns and Trade-offs

Discuss how to handle failures, retries, and data consistency across both systems. Compare SQL vs NoSQL, batch vs stream processing, and caching strategies. Explain how you would monitor and alert on pipeline health.

5. Summarize and Validate

Recap the key design decisions and how they meet the requirements. Suggest ways to test the system, such as load testing for the read path and reconciliation checks for the settlement pipeline.

Key Points to Mention

  • Use of caching and CDN for the food item detail page to handle read-heavy traffic and reduce latency.
  • Denormalization and precomputed aggregates (e.g., average rating, like counts) to avoid expensive joins at read time.
  • Idempotent operations and exactly-once processing in the settlement pipeline to prevent duplicate payouts.
  • Batch processing with a distributed job scheduler (e.g., Airflow) for monthly settlements, with the ability to reprocess on failure.
  • Data partitioning and sharding strategies for both the user-generated content and delivery events to scale horizontally.
  • Monitoring and alerting for pipeline delays, failed payouts, and data inconsistencies, with reconciliation jobs to detect discrepancies.

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

Q2

How do you maintain the rating aggregate for a food item as users submit and update their ratings, without recomputing the average from scratch on every read?

System DesignData Modeling
Author's notes

The incremental approach clicked for me pretty fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Propose maintaining a denormalized aggregate (count and sum of ratings) alongside the item, updated atomically on each rating write. For updates, adjust the sum by the delta between old and new rating, and handle concurrency with optimistic locking or atomic increments. Discuss trade-offs like eventual consistency and idempotency.

Pro tip: Mention that you'd store the sum and count as separate fields rather than just the average, because you can't derive the new average from the old average alone when a rating changes. Also, highlight the importance of idempotent updates to handle retries safely.

1. Clarify requirements and scale

Ask about read/write patterns, expected QPS, consistency needs, and whether ratings can be updated or deleted. This shows you tailor the solution to the problem.

2. Propose denormalized aggregates

Store rating_count and rating_sum (or average and count) on the item record or a separate table. This avoids full recomputation on reads.

3. Define write path updates

On new rating: increment count and add rating to sum. On update: adjust sum by (new_rating - old_rating). On delete: decrement count and subtract rating.

4. Address concurrency and consistency

Use atomic operations (e.g., Redis INCR, SQL UPDATE with WHERE version) or optimistic locking to prevent lost updates. Consider eventual consistency and idempotency for retries.

5. Discuss trade-offs and alternatives

Mention caching, batch updates, or event-driven updates via message queues. Compare with periodic recomputation for accuracy vs. performance.

Key Points to Mention

  • Denormalization: store count and sum separately to compute average on read.
  • Delta updates: for rating changes, adjust sum by difference between new and old rating.
  • Concurrency control: atomic increments, optimistic locking, or transactions to avoid race conditions.
  • Idempotency: ensure updates are idempotent to handle retries without double-counting.
  • Trade-offs: eventual consistency vs. strong consistency, and handling of edge cases like rating deletion.
  • Scalability: consider sharding, caching, or asynchronous processing for high write throughput.

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

Q3

How would you handle like counts on posts at scale, given that hot posts could create write contention on a single counter row?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second on the contention angle.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the write contention problem on a single counter row for hot posts, then propose a sharded counter approach where increments are distributed across multiple rows or partitions. Discuss how to aggregate counts for reads, handle eventual consistency, and trade-offs between accuracy and scalability.

Pro tip: Mention that you would use a combination of sharding and asynchronous aggregation, and that you'd consider using a write-optimized store like Redis or a distributed counter service to absorb the write load, while periodically flushing to a durable store.

1. Identify the bottleneck

Explain that a single counter row per post creates a hotspot for hot posts, leading to lock contention and reduced write throughput.

2. Shard the counter

Propose splitting the counter into N shards (e.g., using a hash of user ID or random shard key) so increments are spread across multiple rows, reducing contention.

3. Aggregate for reads

Describe how to sum the shards on read, either on-demand or via a background job that periodically computes the total and caches it.

4. Handle consistency and durability

Discuss trade-offs: eventual consistency for reads, using a fast store like Redis for writes with periodic persistence, and ensuring no lost updates.

5. Optimize further

Mention additional techniques like batching writes, using a queue to decouple, or employing a CRDT-based counter for distributed environments.

Key Points to Mention

  • Sharded counters to distribute write load
  • Asynchronous aggregation and caching for reads
  • Eventual consistency and trade-offs with accuracy
  • Use of Redis or in-memory stores for high write throughput
  • Batch processing and write coalescing
  • Monitoring and auto-scaling shards based on load

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

Q4

How do you paginate the post feed under a food item at large scale?

System DesignData Modeling
Author's notes

Cursor-based pagination on created_at or post id, not offset.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements (e.g., QPS, latency, consistency). Then propose a cursor-based pagination strategy using a composite index on (food_item_id, created_at, post_id) to efficiently retrieve posts in order. Discuss how to handle real-time updates, caching, and sharding to ensure scalability and low latency.

Pro tip: Emphasize the importance of avoiding offset-based pagination due to performance degradation at scale, and highlight how cursor-based pagination with a stable sort key (like created_at + post_id) prevents duplicates and missing items when new posts are added.

1. Clarify Requirements and Scale

Ask about expected traffic (QPS, number of food items, posts per item), latency SLAs, and consistency requirements. This shows you understand the problem context before diving into solutions.

2. Choose Pagination Strategy

Compare offset-based vs. cursor-based pagination. Recommend cursor-based (keyset) pagination using a composite key (e.g., created_at, post_id) to ensure efficient and stable pagination at scale.

3. Design Data Model and Indexing

Propose a schema where posts are stored with food_item_id, created_at, and post_id. Create a composite index on (food_item_id, created_at DESC, post_id DESC) to support efficient range queries.

4. Address Scalability and Performance

Discuss sharding by food_item_id or using a distributed database like Cassandra or DynamoDB. Mention caching hot feeds and using read replicas to handle high read throughput.

5. Handle Edge Cases and Consistency

Explain how to handle new posts, deleted posts, and updates. Use a stable sort key to avoid duplicates/skips, and consider eventual consistency trade-offs with caching.

Key Points to Mention

  • Cursor-based pagination (keyset pagination) with a composite key (created_at, post_id) to avoid offset inefficiencies.
  • Composite index on (food_item_id, created_at DESC, post_id DESC) for efficient range scans.
  • Sharding strategy (e.g., by food_item_id) to distribute load and enable horizontal scaling.
  • Caching frequently accessed feeds (e.g., Redis) with appropriate TTL and invalidation strategies.
  • Handling real-time updates: new posts should appear at the top without disrupting pagination for ongoing sessions.
  • Trade-offs between consistency and availability, and how to mitigate duplicates or missing items.

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

Q5

Design the month-end driver payout pipeline so that each driver is paid exactly once, even if the job retries or reruns partway through.

System DesignAPI & Integrations
Author's notes

This was the part I found most interesting and also most stressful.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: exactly-once payout semantics, idempotency, and failure recovery. Then propose a design that uses idempotency keys, a state machine for payout status, and transactional guarantees to ensure each driver is paid once. Finally, discuss how to handle retries and reruns, including reconciliation and monitoring.

Pro tip: Emphasize that exactly-once is achieved through idempotent operations and at-least-once delivery, not by trying to prevent retries. Mention that you would use a unique idempotency key per driver per pay period and store it in a database with a unique constraint.

1. Clarify requirements and constraints

Ask about scale (number of drivers, payouts per month), latency requirements, and existing infrastructure. Confirm that exactly-once means no duplicate payments even with retries.

2. Design idempotent payout operations

Use a unique idempotency key (e.g., driver_id + pay_period) for each payout. Before processing, check if the key exists; if so, return the previous result. Store keys in a database with a unique constraint.

3. Implement a state machine and transactional outbox

Model payout as states: PENDING, PROCESSING, PAID, FAILED. Use a transactional outbox to atomically update state and publish events. Ensure state transitions are idempotent.

4. Handle retries and reruns with reconciliation

On retry, the idempotency key prevents duplicate payments. For reruns, use the same keys. Implement reconciliation to detect and resolve discrepancies between internal records and payment provider.

5. Monitor and alert on anomalies

Track metrics like duplicate attempts, payout failures, and reconciliation mismatches. Set up alerts for any duplicate payment attempts or state inconsistencies.

Key Points to Mention

  • Idempotency keys with unique constraints to prevent duplicate payouts
  • State machine for payout lifecycle (e.g., PENDING, PROCESSING, PAID, FAILED)
  • Transactional outbox pattern to ensure atomicity between state changes and event publishing
  • Reconciliation process with payment provider to detect and correct discrepancies
  • Retry logic with exponential backoff and dead-letter queues for failed payouts
  • Monitoring and alerting for duplicate payment attempts and state inconsistencies

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

Q6

The payment processor times out and you don't know if the payment went through. What's your policy?

System DesignTechnical Trade-offs
Author's notes

This is the genuinely hard part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the ambiguity and the need for idempotency to safely retry. Then describe a policy that combines client-side retries with exponential backoff, server-side idempotency keys, and reconciliation via webhooks or polling. Finally, discuss trade-offs between consistency and availability, and how to handle edge cases like duplicate charges.

Pro tip: Emphasize that the policy must be idempotent end-to-end, not just at the API level—include database transactions and external calls. Also mention that you'd log and monitor timeout rates to detect systemic issues.

1. Clarify the scenario and constraints

Ask clarifying questions about the payment processor's behavior, timeout duration, and whether the operation is idempotent. Understand the business impact of duplicate charges vs. missed payments.

2. Design for idempotency

Use idempotency keys generated by the client and stored server-side to ensure that retries don't result in duplicate charges. Ensure the payment processor supports idempotency or implement a deduplication layer.

3. Implement retry with backoff and jitter

On timeout, retry the request with exponential backoff and jitter, but only if the operation is idempotent. Set a maximum retry limit to avoid infinite loops.

4. Reconcile state asynchronously

If retries fail or are not possible, use webhooks or a polling mechanism to check the payment status later. Update the order state based on the final outcome.

5. Handle edge cases and monitor

Define fallback actions for when reconciliation fails (e.g., manual review, customer notification). Log all timeouts and monitor for patterns to improve system reliability.

Key Points to Mention

  • Idempotency keys to prevent duplicate charges
  • Exponential backoff with jitter for retries
  • Webhooks or polling for asynchronous reconciliation
  • Trade-offs between consistency and availability (CAP theorem)
  • Monitoring and alerting for timeout rates
  • User experience: communicating uncertainty to customers

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

Q7

Tips can be edited by customers for up to a week after an order. How does that affect your month-end cutoff and your ledger model?

System DesignData Modeling
Author's notes

The answer that preserves immutability is to never rewrite a settled run.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that the month-end cutoff is a financial reporting concept, while the ledger model must handle late-arriving tip edits without corrupting historical periods. Propose an event-sourced or append-only ledger with effective dates, and explain how to reconcile the cutoff using accruals and adjustments.

Pro tip: Mention that you would treat tip edits as separate adjustment entries rather than mutating original transactions, and that you'd use a 'tip payable' liability account to handle the delay between order completion and final tip settlement.

1. Clarify the business and accounting requirements

Ask whether the month-end cutoff is for revenue recognition, driver payouts, or both, and confirm the exact edit window and any regulatory constraints. This ensures you design for the right invariants.

2. Model the ledger with append-only entries and effective dates

Design a double-entry ledger where each tip edit creates a new adjustment entry with its own timestamp and effective date, never overwriting the original. This preserves auditability and allows point-in-time reconstruction.

3. Handle the cutoff with accruals and period adjustments

At month-end, accrue estimated tips for orders still within the edit window, and post subsequent edits as adjustments to the current period or as prior-period corrections if material. Use a clearing or suspense account to track pending edits.

4. Ensure idempotency and reconciliation

Make tip edit events idempotent and provide reconciliation jobs that compare the sum of original tips plus adjustments against expected totals. This catches discrepancies and ensures the ledger remains balanced.

5. Discuss scalability and query patterns

Explain how you would index by order ID and effective date to efficiently compute balances for any period, and how you would handle high write volume from tip edits without locking the ledger.

Key Points to Mention

  • Double-entry accounting principles and the need for balanced debits/credits
  • Event sourcing or append-only ledger to preserve history
  • Accrual accounting for estimated tips at period close
  • Materiality thresholds for prior-period adjustments
  • Idempotency keys to avoid duplicate adjustments
  • Separation of tip payable liability from revenue recognition

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

Q8

You find that the cached rating aggregate for some items has drifted from the sum of actual rating rows. How did this happen and how do you fix it without taking the page down?

Root Cause AnalysisSystem Design
Author's notes

Drift happens when a write to the aggregate fails after the rating row was already committed, or vice versa.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by hypothesizing common causes of cache drift (e.g., non-atomic updates, race conditions, missed events) and explain how you would diagnose the issue using logs, metrics, and data reconciliation. Then outline a remediation plan that includes a backfill or repair job and preventive measures like transactional updates or periodic reconciliation, all while ensuring the page remains available.

Pro tip: Emphasize the importance of idempotent repair jobs and monitoring to detect drift early, and mention that you would communicate with stakeholders about the fix timeline and potential temporary inconsistencies.

1. Identify the Root Cause

Analyze recent code changes, system logs, and data patterns to determine why the cache drifted, such as a bug in the update logic, race conditions, or failed event processing.

2. Assess Impact and Scope

Quantify how many items are affected and the magnitude of drift, and determine if the issue is ongoing or a one-time occurrence.

3. Design a Non-Disruptive Fix

Create a repair job that recalculates aggregates from source data and updates the cache idempotently, running in the background without affecting page availability.

4. Implement Preventive Measures

Introduce safeguards like transactional updates, event sourcing with idempotent consumers, or periodic reconciliation to prevent future drift.

5. Monitor and Validate

Set up alerts for cache drift and validate that the fix resolved the issue and that preventive measures are working.

Key Points to Mention

  • Atomicity and consistency in cache updates (e.g., using transactions or compare-and-swap)
  • Race conditions and concurrent writes leading to lost updates
  • Event-driven architecture pitfalls like missed or out-of-order events
  • Idempotent repair jobs and backfilling strategies
  • Monitoring and alerting for cache drift detection
  • Graceful degradation and maintaining page availability during fixes

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

Q9

How would you give a user read-your-own-writes consistency on the rating average right after they submit a rating, even though the aggregate is eventually consistent for everyone else?

System DesignTechnical Trade-offs
Author's notes

You can do this cheaply by writing the user's new rating to a short-lived per-user cache entry and computing their personal view of the average client-side or at the edge using that cached value plus the stale aggregate.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the requirements: the user should see their own rating reflected immediately in the average, while other users can tolerate eventual consistency. Then propose a read-time merge strategy where the user's own rating is combined with the eventually consistent aggregate, ensuring correctness without sacrificing scalability.

Pro tip: Mention that you would avoid updating the global aggregate synchronously to prevent hot-key contention and instead handle read-your-writes at the query layer, which is a common pattern at scale.

1. Clarify consistency requirements

Confirm that only the submitting user needs immediate consistency, while others can see stale data. This scopes the problem and avoids over-engineering.

2. Design the data flow

Describe how ratings are written asynchronously to an aggregate store (e.g., via a queue) and how the user's own rating is stored separately for quick retrieval.

3. Implement read-time merge

On read, fetch the eventually consistent aggregate and the user's own rating, then compute the adjusted average on the fly. This ensures the user sees their write immediately.

4. Handle edge cases

Address scenarios like multiple rapid submissions, deletions, or updates to the user's rating, ensuring the merge logic remains correct and idempotent.

5. Discuss trade-offs and alternatives

Compare with other approaches (e.g., synchronous update, session stickiness) and explain why read-time merge is preferable for scalability and simplicity.

Key Points to Mention

  • Eventual consistency of the aggregate store and asynchronous processing
  • Read-your-own-writes consistency model
  • Read-time merge of user-specific data with aggregate
  • Idempotency and handling of duplicate submissions
  • Scalability and avoiding hot-key contention
  • Trade-offs between consistency, latency, and complexity

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