← 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, focused entirely on designing a payment system for delivery drivers from scratch. The question was massive and covered basically every dimension of distributed systems design you can think of. Walked away feeling like I got maybe 60% of it.

Questions Asked (7)

Q1

Design an end-to-end payment system for DoorDash delivery drivers that computes payouts from order lifecycle events. The event stream has records with dasherId, orderId, timestamp, and status (accepted, fulfilled, cancelled). Walk through the full system design including APIs, payout rules, time handling, storage, idempotency, bad data handling, batch vs streaming, reliability, and consistency trade-offs.

System DesignAPI & IntegrationsData Modeling
Author's notes

This is a beast of a question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and assumptions, then walk through the system design in a structured manner covering data flow, APIs, storage, and processing. Emphasize idempotency, event ordering, and consistency trade-offs, and discuss how to handle bad data and ensure reliability.

Pro tip: Proactively discuss how you would handle late-arriving events and out-of-order timestamps, as this is a common real-world challenge in event-driven systems. Also, mention the importance of idempotent payout calculations to avoid double-paying drivers.

1. Clarify Requirements and Assumptions

Ask questions to understand the scope: expected event volume, latency requirements, payout rules, and consistency needs. State assumptions about event ordering, data retention, and failure modes.

2. Design Event Ingestion and Processing Pipeline

Outline how events are ingested (e.g., Kafka), processed (streaming vs batch), and how to handle out-of-order and late events. Discuss windowing and watermarks if using stream processing.

3. Define Payout Computation Logic and APIs

Specify payout rules based on order lifecycle (e.g., base pay + tips + bonuses). Design APIs for drivers to query earnings and for internal systems to trigger payouts. Ensure idempotency in payout calculations.

4. Design Storage and Data Model

Choose appropriate storage for events (e.g., immutable log), payout records (e.g., relational DB with transactions), and driver earnings summaries. Discuss indexing and query patterns.

5. Address Reliability, Consistency, and Bad Data

Explain how to handle failures (retries, dead-letter queues), ensure exactly-once processing (idempotency keys, deduplication), and deal with bad data (validation, quarantine). Discuss consistency trade-offs (e.g., eventual vs strong).

Key Points to Mention

  • Idempotency: Use unique event IDs and idempotent writes to prevent double payouts.
  • Event ordering and late data: Use event timestamps and watermarks to handle out-of-order events; consider reprocessing for corrections.
  • Batch vs streaming: Streaming for real-time updates, batch for reconciliation and corrections; lambda architecture may be suitable.
  • Storage choices: Immutable event log (e.g., Kafka, S3) for audit; transactional DB for payouts; possibly a data warehouse for analytics.
  • Reliability: Retries with exponential backoff, dead-letter queues, monitoring, and alerting.
  • Consistency: Trade-offs between strong consistency for payouts and eventual consistency for earnings display; use of transactions and locking.

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

Q2

How do you define the API between the event producer and the payment service, and what should the earnings query response look like for a dasher?

API & IntegrationsSystem Design
Author's notes

Went async via a message queue pretty quickly, that felt right for decoupling.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of the event-driven system, such as event types, delivery guarantees, and data consistency needs. Then, propose a versioned API contract (e.g., using OpenAPI or AsyncAPI) that defines the event schema and the earnings query response, ensuring it is extensible and backward-compatible. Finally, discuss trade-offs and how the design supports scalability and reliability.

Pro tip: Emphasize idempotency and exactly-once processing for payment events to prevent duplicate earnings, and suggest using a schema registry to manage event evolution. This shows you understand real-world payment system challenges.

1. Clarify Requirements and Constraints

Ask about event volume, latency requirements, delivery guarantees (at-least-once, exactly-once), and data consistency needs. This ensures your design aligns with business and technical constraints.

2. Define the Event Producer API

Specify the event schema (e.g., JSON) with fields like event ID, timestamp, dasher ID, amount, currency, and type. Choose a protocol (e.g., Kafka, HTTP webhooks) and include metadata for idempotency and versioning.

3. Design the Earnings Query Response

Outline a response structure that includes total earnings, breakdown by period (daily, weekly), and details per delivery. Include pagination, filtering, and aggregation options for flexibility.

4. Address Reliability and Scalability

Discuss how to handle failures, retries, and idempotency. Mention partitioning, load balancing, and caching to ensure the system scales with dasher count and query volume.

5. Discuss Trade-offs and Evolution

Explain choices like synchronous vs. asynchronous communication, schema evolution strategies, and how to maintain backward compatibility. Highlight potential bottlenecks and mitigations.

Key Points to Mention

  • Event schema design with versioning and backward compatibility
  • Idempotency keys to prevent duplicate payment processing
  • Delivery guarantees (at-least-once vs. exactly-once) and their implications
  • Earnings query response structure with aggregation and pagination
  • Use of a schema registry for event evolution
  • Scalability considerations: partitioning, caching, and load balancing

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

Q3

What are the payout rules when an order is accepted, fulfilled, or cancelled, and which timestamp do you attribute the payout to?

System DesignTechnical Trade-offs
Author's notes

I fumbled the timestamp attribution question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and the distinction between order lifecycle events and financial settlement. Then, propose a state machine for payouts, specifying rules for each terminal state (accepted, fulfilled, cancelled) and the timestamp attribution (event time vs. processing time). Finally, discuss trade-offs and how to handle edge cases like late cancellations or partial fulfillments.

Pro tip: Emphasize the importance of idempotency and auditability in payout systems, as financial transactions must be exactly-once and traceable. Also, mention that timestamp attribution should align with accounting principles (e.g., revenue recognition) and may require event sourcing for accuracy.

1. Clarify Business Rules

Ask clarifying questions about the platform's payout policies: Does acceptance trigger a payout? Is fulfillment required? What are the cancellation policies (e.g., before pickup, after pickup)? This ensures you address the actual requirements.

2. Define State Machine

Model the order lifecycle as a state machine with states like CREATED, ACCEPTED, FULFILLED, CANCELLED. Define transitions and the payout rules associated with each terminal state.

3. Specify Payout Rules

For each terminal state, specify the payout amount and recipient (e.g., full payout on fulfillment, partial or no payout on cancellation). Consider scenarios like cancellation after acceptance but before fulfillment.

4. Timestamp Attribution

Decide which timestamp to use for payout attribution: the time the event occurred (event time) or the time the payout is processed (processing time). Discuss implications for financial reporting and reconciliation.

5. Address Edge Cases and Trade-offs

Discuss handling of late events, out-of-order events, and idempotency. Trade-offs include consistency vs. latency, and complexity vs. accuracy.

Key Points to Mention

  • Event sourcing and immutable event logs for auditability
  • Idempotent payout processing to avoid double payments
  • Timestamp attribution: event time vs. processing time and their impact on financial reporting
  • State machine design for order lifecycle
  • Handling of partial fulfillments and cancellations
  • Reconciliation and consistency checks between order events and payouts

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

Q4

How do you handle late-arriving or out-of-order events, and what happens when a FULFILL event arrives with no prior ACCEPT?

System DesignRoot Cause Analysis
Author's notes

This is where the bad data section came in.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the general strategies for handling late and out-of-order events in distributed systems, such as event time vs. processing time, watermarks, and buffering. Then, address the specific scenario of a FULFILL event without a prior ACCEPT, discussing detection, handling (e.g., dead-letter queue, reconciliation), and prevention. Emphasize the importance of idempotency, ordering guarantees, and business impact.

Pro tip: Mention that you would instrument and monitor the frequency of such anomalies to drive improvements in upstream systems, showing a proactive and data-driven mindset.

1. Clarify requirements and constraints

Ask about the expected event ordering guarantees, latency requirements, and business impact of out-of-order events. This shows you consider the context before diving into solutions.

2. Explain general strategies for out-of-order events

Discuss techniques like event time processing, watermarks, buffering with timeouts, and reordering using sequence numbers or timestamps. Mention trade-offs between latency and completeness.

3. Address the specific FULFILL without ACCEPT scenario

Describe how to detect such events (e.g., state validation), and handle them: dead-letter queue for manual inspection, automatic reconciliation by querying upstream, or emitting a compensating event. Emphasize idempotency and avoiding duplicate processing.

4. Discuss prevention and system design improvements

Suggest ways to reduce occurrence: ensuring upstream services emit events in order, using a saga pattern, or implementing a state machine that rejects invalid transitions. Also mention monitoring and alerting.

5. Summarize and tie back to business impact

Conclude by reiterating how your approach maintains data consistency and minimizes customer impact, and how you would measure success (e.g., reduced anomaly rate).

Key Points to Mention

  • Event time vs. processing time and watermarks
  • Idempotency and exactly-once processing
  • Dead-letter queues and reconciliation strategies
  • State machines and valid state transitions
  • Monitoring and alerting for anomalies
  • Trade-offs between latency, cost, and consistency

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

Q5

How do you ensure idempotency and avoid double-paying a driver under at-least-once event delivery?

System DesignTechnical Trade-offs
Author's notes

Dedup table keyed on (orderId, status) with a processed flag.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that at-least-once delivery means duplicates are inevitable, so idempotency must be enforced at the payment layer. Then describe a concrete mechanism like idempotency keys tied to a unique business event (e.g., delivery ID) and how you'd store and check them atomically. Finally, discuss trade-offs around storage, latency, and failure modes, and how you'd handle retries and reconciliation.

Pro tip: Emphasize that idempotency should be enforced at the payment processor or ledger level, not just in application code, because distributed systems can fail in ways that bypass application-level checks. Also mention that you'd monitor for duplicate payment attempts and have a reconciliation process to catch any that slip through.

1. Clarify the problem and constraints

Restate that at-least-once delivery means events can be duplicated, and double-paying a driver is unacceptable. Ask about scale, latency requirements, and existing infrastructure (e.g., payment provider, database).

2. Design idempotency key strategy

Propose using a unique idempotency key derived from the business event (e.g., delivery ID + payment type) that remains constant across retries. Explain that the key must be generated by the producer and passed through the entire payment flow.

3. Implement atomic deduplication

Describe storing the idempotency key in a durable, atomic store (e.g., database with unique constraint, Redis with SETNX) before processing payment. If the key exists, return the previous result instead of reprocessing.

4. Handle failures and retries

Explain how to handle partial failures: if payment succeeds but recording the key fails, you need a reconciliation process. Use transactions or two-phase commit where possible, and design for idempotent retries at every step.

5. Discuss trade-offs and monitoring

Talk about trade-offs: storage overhead, latency of deduplication check, and complexity. Mention monitoring for duplicate attempts and a reconciliation job to detect and resolve any discrepancies.

Key Points to Mention

  • Idempotency keys tied to a unique business event (e.g., delivery ID) that are stable across retries.
  • Atomic deduplication using a database unique constraint or Redis SETNX to prevent race conditions.
  • Storing the result of the payment operation alongside the idempotency key to return the same response on retries.
  • Handling the failure scenario where payment succeeds but the idempotency record is not persisted (e.g., via reconciliation or transactional outbox).
  • Trade-offs: increased storage, added latency, and complexity versus the cost of double-paying.
  • Monitoring and alerting for duplicate payment attempts, and a reconciliation process to catch and correct any that occur.

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

Q6

When do you use streaming vs batch processing for payout computation, and how do you handle backfills and end-of-period reconciliation?

System DesignTechnical Trade-offs
Author's notes

Said streaming for near-real-time visibility to drivers, batch finalization at pay period close to catch any late events and do a consistency check.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of payout computation, then compare streaming and batch processing based on latency, accuracy, and cost. Explain how you would combine both approaches for backfills and end-of-period reconciliation, emphasizing correctness and idempotency.

Pro tip: Emphasize that payouts require strong consistency and auditability, so batch processing is often the source of truth while streaming provides near-real-time estimates. Mention that backfills must be idempotent and reconciliation should be automated with alerts for discrepancies.

1. Clarify Requirements

Ask about latency needs, accuracy requirements, volume, and regulatory constraints to determine the appropriate processing model.

2. Compare Streaming vs Batch

Discuss trade-offs: streaming offers low latency but may sacrifice accuracy and increase complexity; batch provides high accuracy and is easier to audit but has higher latency.

3. Design Hybrid Architecture

Propose using streaming for real-time estimates and batch for final payouts, ensuring consistency between the two.

4. Handle Backfills

Explain how to reprocess historical data idempotently, possibly using batch jobs that overwrite or correct previous results.

5. Implement Reconciliation

Describe end-of-period reconciliation: compare streaming and batch results, detect discrepancies, and trigger alerts or corrections.

Key Points to Mention

  • Idempotency in backfills to avoid double payouts
  • Exactly-once processing semantics in streaming
  • Batch processing for final, auditable payouts
  • Reconciliation between streaming and batch outputs
  • Handling late-arriving data and windowing
  • Cost and complexity trade-offs

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

Q7

How do you sketch the key classes and methods for event ingestion and payout calculation, and how does the API handle querying a dasher's earnings for a local pay period including timezone and DST?

System DesignAPI & Integrations
Author's notes

Ran out of time here so this was rushed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then sketch a high-level architecture for event ingestion and payout calculation, focusing on data flow and key classes. Next, detail the API design for querying earnings, explicitly addressing timezone and DST handling to ensure correctness.

Pro tip: Demonstrate awareness of edge cases like DST transitions and timezone database updates, and propose idempotent event processing to avoid double-counting in payouts.

1. Clarify Requirements and Constraints

Ask about scale, event types, payout rules, and query patterns. Confirm the need for timezone-aware earnings queries and DST handling.

2. Design Event Ingestion Pipeline

Sketch classes like EventCollector, EventProcessor, and EventStore. Emphasize idempotency, ordering, and scalability using queues and partitions.

3. Design Payout Calculation

Outline PayoutCalculator, EarningsAggregator, and RuleEngine. Discuss batch vs. real-time processing and how to handle late events.

4. Design Earnings Query API

Define endpoints like GET /dashers/{id}/earnings?start=...&end=...&timezone=.... Explain how to resolve local pay period boundaries using timezone data.

5. Address Timezone and DST Handling

Explain storing timestamps in UTC, converting to local time for queries, and using libraries like IANA tz database. Discuss DST edge cases (e.g., ambiguous times).

Key Points to Mention

  • Idempotent event processing to prevent duplicate payouts
  • Use of UTC timestamps internally and timezone conversion at query time
  • Handling DST transitions (spring forward/fall back) and ambiguous local times
  • Partitioning and scaling event ingestion (e.g., by dasher_id or region)
  • Caching or pre-aggregating earnings for performance
  • API design with clear parameters for time range and timezone

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