← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

DoorDash coding round for a software engineer role. The problem was a dasher pay calculator with a bunch of edge cases baked in. More involved than it looks on the surface.

Questions Asked (1)

Q1

Given a list of delivery events (dasher ID, pickup time, dropoff time, distance, tip, optional bonuses) and a configurable set of pay rules (base pay per order, per-distance rate, per-minute rate, tips, bonuses), write a program that calculates each dasher's total pay for a shift. You need to define and validate the input schema, handle overlapping deliveries and missing fields, round correctly to cents, group results by day and dasher sorted by ID, and write tests covering at least three different pay configurations.

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

This one took me a while to fully parse.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining a robust input schema with validation, then design a modular pay calculation engine that applies configurable rules per delivery, handles edge cases like overlapping deliveries and missing fields, and aggregates results by day and dasher. Finally, outline a comprehensive test plan covering multiple pay configurations and rounding correctness.

Pro tip: Emphasize that you would separate the pay rule configuration from the calculation logic to allow easy updates and testing, and proactively discuss how you'd handle ambiguous cases like overlapping deliveries by clarifying with stakeholders or making reasonable assumptions.

1. Clarify Requirements and Define Schema

Ask clarifying questions about pay rules, overlapping deliveries, and missing fields. Define a clear input schema for delivery events and pay rules, including data types and validation constraints.

2. Design Pay Calculation Logic

Break down pay into components (base, distance, time, tips, bonuses) and design a function that computes pay per delivery based on configurable rules. Handle edge cases like overlapping deliveries by defining rules (e.g., sum time or take max) and missing fields with defaults or errors.

3. Implement Aggregation and Rounding

Group results by day and dasher ID, summing pay components. Apply rounding to cents at the appropriate stage (e.g., per delivery or final total) using a consistent method like round half up.

4. Write Tests for Multiple Configurations

Create test cases covering at least three different pay configurations (e.g., different rates, bonuses, missing fields) and edge cases like overlapping deliveries and rounding. Use a testing framework to validate expected outputs.

5. Discuss Trade-offs and Scalability

Talk about trade-offs in design choices (e.g., per-delivery vs. per-shift rounding, handling overlaps) and how the solution could scale with large datasets or real-time processing.

Key Points to Mention

  • Input validation and schema definition to ensure data integrity
  • Modular design with configurable pay rules for flexibility
  • Handling overlapping deliveries: define clear rules (e.g., sum time, max time) and document assumptions
  • Rounding strategy: use integer cents or decimal with round half up to avoid floating-point errors
  • Grouping and sorting: aggregate by day and dasher ID, sort by ID for deterministic output
  • Comprehensive testing: cover multiple pay configurations, edge cases, and rounding scenarios

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