← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

DoorDash coding round focused on a pretty involved simulation problem around their Dasher pay system. More edge cases than I expected and the domain knowledge tripped me up a bit.

Questions Asked (1)

Q1

Given a sequence of delivery driver shift events (shift start/end, offer, accept, pickup, dropoff, cancel, each with timestamps and metadata like miles and tips), implement a function that calculates the driver's total pay. The pay model includes base pay per delivery, per-mile, per-minute rates, and tips, plus a minimum pay guarantee for the shift. Your solution should also handle out-of-order or missing events.

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

This one took me a while to even parse.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the pay model and event semantics first, then design a state machine that processes events in timestamp order, handling out-of-order and missing events via sorting and validation. Compute pay per delivery and apply the shift minimum guarantee, discussing trade-offs between batch and streaming processing.

Pro tip: Explicitly discuss how you would handle out-of-order events (e.g., using a priority queue or sorting by timestamp) and missing events (e.g., inferring from context or flagging for review), as this demonstrates production-level thinking.

1. Clarify Requirements and Assumptions

Ask about the exact pay formula, event ordering guarantees, and what constitutes a missing event. Confirm whether events can be duplicated or arrive late.

2. Design Data Structures and State Machine

Define a state machine for deliveries (e.g., offered -> accepted -> picked up -> dropped off) and choose data structures to track active deliveries and shift totals.

3. Handle Out-of-Order and Missing Events

Sort events by timestamp or use a priority queue to process in order. For missing events, decide whether to infer (e.g., assume dropoff if pickup exists) or skip and log.

4. Compute Pay and Apply Guarantee

Calculate base, mileage, time, and tips per delivery, sum them, and compare with the shift minimum guarantee to determine final pay.

5. Discuss Trade-offs and Edge Cases

Talk about batch vs. streaming, memory vs. accuracy, and how to handle cancellations, partial data, and timezone issues.

Key Points to Mention

  • Event ordering: use timestamp sorting or priority queue to handle out-of-order events.
  • State machine for delivery lifecycle: offer, accept, pickup, dropoff, cancel.
  • Missing event handling: infer from context or flag for manual review.
  • Pay calculation: base + per-mile + per-minute + tips, then apply shift minimum guarantee.
  • Trade-offs: batch processing (simpler, higher latency) vs. streaming (complex, real-time).
  • Edge cases: cancellations, duplicate events, timezone differences, and partial shifts.

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