← DoorDash Interview Insights

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

Senior
May 2026

Summary

DoorDash system design round for a software engineer role, and the problem was a full payout engine for gig workers. Way more surface area than I expected for a single session.

Questions Asked (6)

Q1

Design a payout calculator for gig workers like delivery drivers. Given completed orders with timestamps, distances, and tips, plus policy tables covering base pay, distance and time multipliers, surge pricing, batching rules, cancellations, and minimum guarantees, how would you compute per-order pay, per-shift summaries, and weekly statements?

System DesignData Modeling
Author's notes

I started with the schema because it felt like the safest entry point, orders table, policy tables, adjustments.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scope, then model the domain entities and policy rules as a versioned rules engine. Design a computation pipeline that ingests order events, applies policies deterministically, and produces per-order, per-shift, and weekly aggregates with auditability.

Pro tip: Emphasize idempotency and versioning of policy tables—payouts must be reproducible and auditable, so store the exact policy version used for each calculation. Also, discuss how you'd handle late-arriving events and retroactive adjustments.

1. Clarify Requirements and Scope

Ask about scale, real-time vs batch, policy update frequency, and edge cases like cancellations, batching, and minimum guarantees. Confirm output formats and latency expectations.

2. Model Domain and Policies

Define entities: orders, shifts, workers, policy tables (base pay, multipliers, surge, batching, cancellations, minimums). Represent policies as versioned, configurable rules to support changes without code deploys.

3. Design Computation Pipeline

Outline a pipeline: ingest order events, validate, apply policies in a deterministic order (base, distance/time multipliers, surge, batching, cancellations, minimum guarantee), and compute per-order pay. Ensure idempotency and handle late events.

4. Aggregate and Store Results

Aggregate per-order pay into per-shift and weekly summaries. Store computed payouts with policy version and audit trail. Consider materialized views or pre-aggregation for performance.

5. Address Edge Cases and Scalability

Discuss handling of cancellations, batching (multiple orders per trip), minimum guarantees (top-ups), and retroactive policy changes. Scale via partitioning, caching, and async processing.

Key Points to Mention

  • Versioned policy tables to ensure reproducibility and auditability of payouts.
  • Idempotent computation to handle retries and late-arriving events.
  • Deterministic order of policy application (e.g., base pay, then multipliers, then surge, then batching, then minimum guarantee).
  • Batching rules: how to allocate pay across multiple orders in a single trip.
  • Minimum guarantee: compute top-up if total pay falls below threshold.
  • Data modeling: star schema or event sourcing for orders, shifts, and payouts.

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

Q2

How would you handle partial cancellations and stacked deliveries in the payout model, and what does that do to your schema?

System DesignTechnical Trade-offsData Modeling
Author's notes

Batching and partial cancellations in the same question is a lot.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of partial cancellations and stacked deliveries, then propose a data model that separates orders, deliveries, and payouts to handle these scenarios. Discuss trade-offs between normalization and denormalization, and explain how your schema supports accurate and efficient payout calculations.

Pro tip: Emphasize idempotency and auditability in your design—payouts must be recalculable and traceable, so include immutable ledgers and versioning. Also, mention how you'd handle edge cases like multiple dashers on a stacked delivery and partial refunds affecting payouts.

1. Clarify Requirements

Ask questions to understand the business rules: How are stacked deliveries assigned? What triggers partial cancellations? How should payouts be split among dashers? This ensures your design addresses real needs.

2. Model Core Entities

Define entities like Order, Delivery, Dasher, Payout, and Cancellation. Consider relationships: one delivery can have multiple orders (stacked), and one order can have multiple payouts (partial).

3. Design Payout Schema

Propose a schema that supports partial cancellations and stacked deliveries. For example, a Payout table with fields for delivery_id, order_id, amount, status, and a separate PayoutAdjustment table for cancellations. Use foreign keys and indexes for performance.

4. Handle Edge Cases

Discuss how to handle scenarios like a stacked delivery where one order is cancelled, or a partial cancellation that affects multiple dashers. Explain how your schema ensures correct payout splits and adjustments.

5. Discuss Trade-offs

Compare normalization vs. denormalization, and the impact on read/write performance, consistency, and scalability. Mention how you'd ensure idempotency and auditability in payout calculations.

Key Points to Mention

  • Entity relationships: Order, Delivery, Dasher, Payout, Cancellation
  • Normalization vs. denormalization trade-offs for payout calculations
  • Idempotency and auditability in payout processing
  • Handling partial cancellations: prorating payouts and adjustments
  • Stacked deliveries: assigning multiple orders to one delivery and splitting payouts
  • Indexing and query performance for payout reporting

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

Q3

How do you handle negative adjustments and chargebacks without corrupting a driver's already-issued pay statement?

System DesignTechnical Trade-offs
Author's notes

Immutable ledger was my answer, append-only rows for every adjustment.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that pay statements are immutable financial records, so adjustments must be handled as separate ledger entries rather than modifying the original. Then propose an append-only adjustment system with idempotent processing and clear reconciliation to ensure accuracy and auditability.

Pro tip: Emphasize that negative adjustments should never alter the original pay statement; instead, they create a new compensating entry. This preserves the integrity of historical data and simplifies audits, a key concern in fintech.

1. Clarify immutability requirement

State that pay statements are immutable once issued, so adjustments must be recorded as separate transactions. This prevents corruption of historical records and ensures compliance.

2. Design append-only ledger

Propose an append-only ledger where each adjustment (negative or positive) is a new entry linked to the original pay statement. Use unique identifiers and timestamps for traceability.

3. Ensure idempotency and ordering

Implement idempotent processing to handle duplicate chargebacks and ensure adjustments are applied exactly once. Use sequence numbers or timestamps to maintain correct ordering.

4. Handle reconciliation and reporting

Provide a reconciliation view that aggregates original pay plus adjustments to show net pay. Ensure reports can trace each adjustment back to its source (e.g., chargeback ID).

5. Address edge cases and failures

Discuss handling of partial adjustments, reversals, and failed transactions. Include retry mechanisms and dead-letter queues for reliability.

Key Points to Mention

  • Immutability of pay statements
  • Append-only ledger design
  • Idempotency to prevent duplicate adjustments
  • Audit trail and traceability
  • Reconciliation and net pay calculation
  • Event-driven architecture for adjustments

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

Q4

Walk through how rounding and currency precision should be handled across per-order, per-shift, and weekly aggregations to avoid accumulated drift.

Technical Trade-offsSystem Design
Author's notes

Storing everything in integer cents and only converting to decimal at display time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by establishing the principle of storing monetary values in the smallest indivisible unit (e.g., cents) as integers to avoid floating-point errors. Then explain how rounding should be applied only at the point of final presentation or settlement, not at intermediate aggregation steps, to prevent drift. Finally, discuss how to handle per-order, per-shift, and weekly aggregations by summing exact integer amounts and only rounding when displaying or charging, with clear rules for any necessary rounding at each level.

Pro tip: Mention that you would use a consistent rounding mode (e.g., banker's rounding) and document it, and that you'd consider using a decimal library or fixed-point arithmetic for any fractional calculations. Also, emphasize the importance of reconciliation and auditing to catch drift early.

1. Choose a consistent representation

Decide to store all monetary values as integers in the smallest unit (e.g., cents) to avoid floating-point inaccuracies. This ensures exact arithmetic across all aggregations.

2. Define rounding rules and timing

Specify when rounding occurs: only at the final step (e.g., when presenting to the user or charging a card) and not during intermediate sums. Use a consistent rounding mode and document it.

3. Handle per-order calculations

For each order, compute totals using integer arithmetic. If any per-order rounding is required (e.g., for tax), apply it at the order level and store the rounded amount, but be aware that this can introduce drift when summed.

4. Aggregate for shifts and weeks

Sum the exact integer amounts from orders for shift and weekly totals without rounding. Only round the final aggregated value when necessary, and ensure that the sum of rounded per-order amounts matches the rounded aggregate to avoid discrepancies.

5. Implement reconciliation and monitoring

Set up periodic reconciliation checks to compare aggregated totals against the sum of individual orders, and monitor for drift. Use idempotent operations and audit logs to trace any discrepancies.

Key Points to Mention

  • Use integer arithmetic (e.g., cents) instead of floating-point to avoid precision errors.
  • Apply rounding only at the final presentation or settlement step, not during intermediate aggregations.
  • Be consistent with rounding mode (e.g., half-up, banker's rounding) and document it clearly.
  • Consider the impact of per-order rounding on aggregated totals and how to reconcile differences.
  • Use decimal libraries or fixed-point types if fractional calculations are unavoidable.
  • Implement monitoring and reconciliation to detect and correct drift over time.

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

Q5

How do you handle events that arrive late and cross timezone or shift boundaries, especially for idempotent reprocessing?

System DesignAlgorithms & Data Structures
Author's notes

This was the hardest part for me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the event schema and business requirements, then propose a robust architecture that decouples event time from processing time using event-time semantics and watermarks. Emphasize idempotency through unique event IDs and deduplication, and explain how to handle late events with configurable lateness thresholds and reprocessing strategies.

Pro tip: Mention that you would use a dead-letter queue for events that are too late, and periodically reprocess them with a batch job to ensure eventual consistency. Also, highlight the importance of monitoring lateness metrics to tune thresholds.

1. Clarify Requirements and Constraints

Ask about the expected lateness, timezone handling, and business impact of late events. Understand the event schema and whether events carry timestamps and unique IDs.

2. Design Event-Time Processing with Watermarks

Propose using event-time processing (e.g., Apache Flink, Spark Structured Streaming) with watermarks to handle out-of-order events. Define a lateness threshold based on business needs.

3. Ensure Idempotency and Deduplication

Use unique event IDs and maintain a deduplication store (e.g., Redis, database) to avoid double processing. For reprocessing, ensure operations are idempotent by design.

4. Handle Late Events and Reprocessing

Route events beyond the watermark to a dead-letter queue. Periodically reprocess them with a batch job that merges results idempotently, possibly using a lambda architecture.

5. Monitor and Tune

Track metrics like lateness distribution and watermark lag. Adjust thresholds and reprocessing frequency based on observed patterns and business SLAs.

Key Points to Mention

  • Event-time vs processing-time semantics and watermarks
  • Idempotency via unique event IDs and deduplication stores
  • Dead-letter queues for late events and batch reprocessing
  • Timezone normalization to UTC and shift boundary handling
  • Monitoring lateness metrics and tuning thresholds
  • Exactly-once processing guarantees and idempotent writes

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

Q6

What tests would you write to cover both typical and extreme scenarios for this payout system?

Technical Trade-offsSystem Design
Author's notes

Rattled off the obvious ones: single order, zero tip, exactly at minimum guarantee threshold.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the payout system's components and requirements, then structure your answer around a test pyramid (unit, integration, end-to-end) covering typical and extreme scenarios. Focus on edge cases like zero/negative amounts, currency rounding, concurrency, and failure recovery, and explain how you'd prioritize tests based on risk.

Pro tip: Mention that you'd use property-based testing (e.g., QuickCheck) to automatically generate extreme inputs and verify invariants like 'total payouts equal sum of individual payouts'—this shows depth beyond manual test cases.

1. Clarify the System and Scope

Ask questions to understand the payout system's architecture, inputs, outputs, and business rules (e.g., currencies, fees, schedules). This ensures your tests target the right components and risks.

2. Identify Typical and Extreme Scenarios

List common cases (e.g., standard payout amount, single currency) and extreme cases (e.g., zero/negative amounts, max limits, multiple currencies, concurrent payouts). Consider both valid and invalid inputs.

3. Map Tests to the Test Pyramid

For each scenario, decide the appropriate test level: unit tests for calculation logic, integration tests for database/API interactions, and end-to-end tests for critical user flows. Explain why you'd choose each level.

4. Prioritize and Explain Trade-offs

Discuss how you'd prioritize tests based on risk (e.g., financial correctness, concurrency) and trade-offs like test speed vs. coverage. Mention any tests you might skip and why.

5. Summarize and Validate

Conclude with a concise summary of your test plan, and suggest how you'd validate it (e.g., mutation testing, code coverage). Emphasize continuous improvement of the test suite.

Key Points to Mention

  • Edge cases: zero, negative, maximum, and fractional payout amounts; currency conversion and rounding.
  • Concurrency and idempotency: handling simultaneous payout requests and preventing duplicate payouts.
  • Failure scenarios: network timeouts, database errors, and retry logic; ensuring consistency.
  • Test types: unit, integration, end-to-end, and property-based testing for invariant checking.
  • Security and compliance: authorization, audit logging, and regulatory constraints (e.g., PCI, GDPR).
  • Performance and load testing: simulating high-volume payout periods to ensure scalability.

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