← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

DoorDash coding interview focused entirely on a payment calculation problem for delivery drivers. The problem sounds straightforward but the edge cases pile up fast and the interviewer was watching for clean code without unnecessary complexity.

Questions Asked (1)

Q1

Given a stream of events for a delivery driver (shift_start, offer, accept, pickup, dropoff, cancel, shift_end, each with timestamps and metadata like miles and tips), calculate the total pay owed. The pay model includes base pay per delivery, per-mile, per-minute, tips, and a minimum pay guarantee for the shift.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

I started by sketching out a state machine in my head and that was probably the right instinct, but I got sidetracked thinking about data structures before I'd even nailed down the core logic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the pay model and event semantics first, then outline a stateful streaming approach that processes events in order, computes per-delivery pay, and applies the shift-level minimum guarantee. Discuss trade-offs between real-time and batch processing, and how to handle edge cases like cancellations and late events.

Pro tip: Emphasize idempotency and exactly-once processing to avoid double-paying drivers, and mention that the minimum guarantee should be applied only after aggregating all deliveries in the shift.

1. Clarify Requirements and Assumptions

Ask about the exact pay formula, event ordering guarantees, and how cancellations affect pay. Confirm whether the minimum guarantee is per shift or per delivery.

2. Define State and Event Processing

Identify the state needed: current shift, active delivery, accumulated pay components. Process events in timestamp order, updating state and computing pay upon dropoff or cancel.

3. Compute Pay Components

For each completed delivery, calculate base pay, mileage pay, time pay, and tips. Sum these to get delivery pay. Track total shift pay.

4. Apply Minimum Guarantee

At shift_end, compare total shift pay to the minimum guarantee. If total pay is less, adjust to the guarantee amount.

5. Discuss Scalability and Trade-offs

Talk about handling out-of-order events, late data, and scalability. Consider batch vs. streaming, and how to ensure correctness with retries.

Key Points to Mention

  • Event-driven architecture with stateful processing (e.g., using a stream processor like Kafka Streams or Flink).
  • Idempotency and exactly-once semantics to prevent duplicate payments.
  • Handling cancellations: whether canceled deliveries count toward pay or minimum guarantee.
  • Time-based pay calculation: using timestamps to compute active time (e.g., from accept to dropoff).
  • Minimum guarantee application: only after aggregating all deliveries in the shift.
  • Trade-offs between real-time calculation and batch processing for accuracy and latency.

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