← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

DoorDash coding round focused entirely on domain-specific payment logic for their dasher platform. Not your typical leetcode grind, which honestly threw me a bit.

Questions Asked (1)

Q1

Design and implement the payment calculation system for a delivery driver. Given inputs like base pay, per-mile rate, per-minute rate, tips, peak-pay multipliers, and guaranteed minimums, define the data classes and write a function that computes the final payout with proper edge-case handling.

Algorithms & Data StructuresData ModelingTechnical Trade-offs
Author's notes

This one was more involved than I expected for a phone screen.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and edge cases with the interviewer, then define clean data classes (e.g., using dataclasses) to model the inputs and payout components. Write a modular function that computes each component (base, mileage, time, tips, peak multiplier, guaranteed minimum) and combines them with proper rounding and validation. Test with representative and edge cases to ensure correctness.

Pro tip: Mention that you would use integer cents for all monetary calculations to avoid floating-point errors, and discuss how you'd handle rounding consistently (e.g., round half up) to align with business rules.

1. Clarify Requirements and Edge Cases

Ask questions to understand the exact payout formula, precedence of rules (e.g., peak multiplier applies before or after tips), and edge cases like negative values, zero distances, or missing tips.

2. Design Data Classes

Define immutable data classes for inputs (e.g., DeliveryInput) and outputs (e.g., PayoutBreakdown) using appropriate types (e.g., Decimal or int for money) and validation in constructors.

3. Implement Calculation Logic

Write a function that computes each component step by step: base pay, mileage pay, time pay, tips, apply peak multiplier, and finally enforce the guaranteed minimum. Use helper functions for clarity.

4. Handle Edge Cases and Validation

Add checks for invalid inputs (negative rates, null tips), handle zero values gracefully, and ensure rounding is consistent. Consider using exceptions or default values as appropriate.

5. Test and Discuss Trade-offs

Walk through test cases (normal, edge, and error cases) and discuss trade-offs like using Decimal vs. int, immutability vs. flexibility, and extensibility for future rules.

Key Points to Mention

  • Use of immutable data classes (e.g., Python dataclasses) with type hints for clarity and safety.
  • Monetary calculations should use integer cents or Decimal to avoid floating-point precision issues.
  • Clear separation of concerns: input validation, component calculation, and final aggregation.
  • Handling of peak multipliers: clarify whether they apply to base pay, mileage, time, or total before tips.
  • Guaranteed minimum logic: compute total earnings and compare to minimum, ensuring tips are not used to satisfy minimum if required by law.
  • Rounding strategy: consistent rounding (e.g., round half up) and where to apply it (per component or final total).

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