Compute dasher pay from deliveries
DoorDashSoftware Engineer · OnsiteLast updated
This question evaluates competency in data manipulation, schema design and validation, time-based aggregation, pay-computation logic, and handling of edge cases using SQL or Python.
Given a list of delivery events for dashers (e.g., dasherId, pickupTime, dropoffTime, distance, tip, and optional bonuses) and a set of pay rules (e.g., base pay per order, per-distance rate, per-minute rate, and additive tips/bonuses), implement a program that outputs each dasher’s total pay for a shift or day. Requirements: (
- Define and validate an input format and pay-rule schema; (
- Handle overlapping deliveries, missing fields, and rounding to cents; (
- Support grouping by day and by dasher, with output sorted by dasherId; (
- Provide tests covering at least three different pay configurations.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.