← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

DoorDash coding screen focused on a stream processing problem involving order events. Pretty domain-specific for a food delivery company, which I guess makes sense, but it still caught me a bit flat-footed.

Questions Asked (1)

Q1

Given a stream of order events, each containing an order ID, dasher ID, timestamp, and a status of ACCEPTED, FULFILLED, or CANCELED, write a function that takes a dasher ID and returns their total pay. Pay is calculated as the number of currently ongoing deliveries multiplied by a base rate of 0.3, where an ongoing delivery is one that has been accepted but not yet fulfilled or canceled.

Algorithms & Data StructuresSystem Design
Author's notes

My first instinct was to just filter by dasherId and count ACCEPTEDs, which is wrong because you have to subtract out the ones that got FULFILLED or CANCELED afterward.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (e.g., stream processing, memory limits, multiple events per order) and then propose a solution using a hash map to track ongoing deliveries per dasher. For each event, update the dasher's ongoing count based on the status, and compute pay as ongoing count * 0.3. Discuss trade-offs between real-time processing and batch processing.

Pro tip: Emphasize that the solution should handle out-of-order events and duplicate events gracefully, as real-world streams often have these issues. Mention that you would use a sliding window or session window if the stream is unbounded.

1. Clarify requirements and constraints

Ask about the stream's nature (ordered vs. unordered, duplicates), memory limits, and whether pay should be computed in real-time or on-demand. Confirm the definition of 'ongoing' and how to handle multiple events for the same order.

2. Design data structures

Use a hash map to store the set of ongoing order IDs for each dasher, and another map to track the status of each order to avoid double-counting. Alternatively, maintain a count per dasher if we can assume events are processed in order.

3. Process events and update state

For each event, if status is ACCEPTED, add the order ID to the dasher's ongoing set; if FULFILLED or CANCELED, remove it. Update the dasher's ongoing count accordingly.

4. Compute pay

For a given dasher ID, return the size of their ongoing set multiplied by 0.3. If using a count, simply return count * 0.3.

5. Discuss scalability and edge cases

Address handling of out-of-order events (e.g., FULFILLED before ACCEPTED), duplicates, and memory usage. Propose solutions like event-time processing with watermarks or using a database for persistence.

Key Points to Mention

  • Use of hash maps for O(1) updates and lookups
  • Handling out-of-order events and duplicates
  • Real-time vs. batch processing trade-offs
  • Memory constraints and potential need for external storage
  • Definition of 'ongoing' and how to track order lifecycle
  • Scalability to multiple dashers and high event throughput

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