DoorDash software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
Question You are in charge of implementing the Dasher payment model. Given the sequence of accepted/fulfilled order activities from a given dasher...
Input: Listtemplate string consisting only of the characters '0', '1', and '?', and a list of integers run_lengths. A '?' in the...Input: Array of integersDirectoryRegistry class that manages a hierarchical key-value store modeled as a tree of paths. The root path "/" always exists with...Input: Stringrecords, a list of ride events. Each record is a list of three strings: [ride_id, timestamp, status]. Possible statuses are...Input: ListSystem Design Questions - DoorDash These are the commonly asked system design questions from DoorDash interviews. Updated January 2026.
Input: Linked listdelivery_id, dasher_id, accepted_min, completed_min, wait_minutes, and tip. Times are integer minute offsets on one shared timeline; money is a decimal string with exactly two fractional digits.[accepted_min, completed_min). For each Dasher, BASE_PAY is $0.30 per minute multiplied by min(2, active_delivery_count). Three simultaneous deliveries therefore earn $0.60 per minute, not $0.90. Inactive time earns nothing.WAIT_BONUS is computed independently for every delivery: $0.20 × max(0, wait_minutes - 10). This bonus is additional to base pay.TIPS is the sum of all tips and is never capped or reduced.dasher_id, containing base pay, wait bonus, tips, and total pay. Empty input returns an empty result. The return type is up to you; the examples show the required information as JSON. Represent monetary results exactly, without floating-point arithmetic.calculate_payout(deliveries: list[dict[str, str]])Example 1:{
"deliveries": [
{"delivery_id":"a","dasher_id":"d1","accepted_min":"0","completed_min":"20","wait_minutes":"12","tip":"2.00"},
{"delivery_id":"b","dasher_id":"d1","accepted_min":"10","completed_min":"30","wait_minutes":"10","tip":"1.00"},
{"delivery_id":"c","dasher_id":"d1","accepted_min":"15","completed_min":"25","wait_minutes":"0","tip":"0.00"},
{"delivery_id":"d","dasher_id":"d2","accepted_min":"0","completed_min":"10","wait_minutes":"0","tip":"3.00"},
{"delivery_id":"e","dasher_id":"d2","accepted_min":"10","completed_min":"20","wait_minutes":"10","tip":"0.00"}
]
}[
{"dasher_id":"d1","base_pay":"13.50","wait_bonus":"0.40","tips":"3.00","total_pay":"16.90"},
{"dasher_id":"d2","base_pay":"6.00","wait_bonus":"0.00","tips":"3.00","total_pay":"9.00"}
]10×1 + 5×2 + 5×2 + 5×2 + 5×1 = 45, giving $13.50. Only delivery a exceeds the wait threshold, earning 2×$0.20 = $0.40; total pay is $13.50 + $0.40 + $3.00 = $16.90. For d2, the touching intervals contribute 20 active minutes, giving $6.00 + $3.00 = $9.00.Part 2 — Apply independently configured promotionspromotions. Every promotion applies independently to every Dasher appearing in the delivery input. Discuss how the return type changes to explain adjustments before implementing this extension. The approach must be flexible enough to support future promotion types without rewriting the Part 1 earnings rules.PEAK map contains rule_id, type, start_min, end_min, rate, and cap. Its raw reward is rate × capped active-delivery minutes within [start_min, end_min), using the same min(2, active_delivery_count) as base pay. Its credited reward is min(raw reward, cap). The cap applies separately to each Dasher and each rule. Overlapping PEAK rules stack; neither consumes another's cap.GUARANTEE map contains rule_id, type, min_deliveries, and amount. A Dasher qualifies when their number of input delivery records is at least min_deliveries. A qualifying rule credits max(0, amount - eligible_earnings), where eligible earnings include base pay, wait bonus, all PEAK rewards, and previously credited GUARANTEE adjustments, but exclude tips. A nonqualifying rule credits $0.00.rule_id order, then all GUARANTEE rules in lexicographic rule_id order. Consequently, multiple guarantees establish a floor rather than being summed as separate bonuses.adjustments list to each result whenever the promotions argument is supplied, even if that argument is empty. Include every configured rule, including zero-dollar adjustments, in evaluation order. Each adjustment identifies rule_id and credited amount. Final total pay includes all adjustments and tips.calculate_payout(deliveries: list[dict[str, str]], promotions: list[dict[str, str]] | None = None)Example 2:{
"deliveries": [
{"delivery_id":"a","dasher_id":"d1","accepted_min":"0","completed_min":"20","wait_minutes":"12","tip":"2.00"},
{"delivery_id":"b","dasher_id":"d1","accepted_min":"10","completed_min":"30","wait_minutes":"10","tip":"1.00"},
{"delivery_id":"d","dasher_id":"d2","accepted_min":"0","completed_min":"10","wait_minutes":"0","tip":"3.00"},
{"delivery_id":"e","dasher_id":"d2","accepted_min":"10","completed_min":"20","wait_minutes":"10","tip":"0.00"}
],
"promotions": [
{"rule_id":"G_SHIFT","type":"GUARANTEE","min_deliveries":"2","amount":"15.00"},
{"rule_id":"P_LUNCH","type":"PEAK","start_min":"10","end_min":"25","rate":"0.10","cap":"2.00"}
]
}[
{"dasher_id":"d1","base_pay":"12.00","wait_bonus":"0.40","tips":"3.00","adjustments":[{"rule_id":"P_LUNCH","amount":"2.00"},{"rule_id":"G_SHIFT","amount":"0.60"}],"total_pay":"18.00"},
{"dasher_id":"d2","base_pay":"6.00","wait_bonus":"0.00","tips":"3.00","adjustments":[{"rule_id":"P_LUNCH","amount":"1.00"},{"rule_id":"G_SHIFT","amount":"8.00"}],"total_pay":"18.00"}
]10×2 + 5×1 = 25 capped minutes yield $2.50, capped at $2.00. Eligible earnings become $12.00 + $0.40 + $2.00 = $14.40, so the guarantee adds $0.60; tips bring the total to $18.00. d2 has 10 capped minutes inside the PEAK window, earning $1.00; eligible earnings are $7.00, so the guarantee adds $8.00, followed by $3.00 in tips.Example 3:{
"deliveries": [
{"delivery_id":"x","dasher_id":"d1","accepted_min":"0","completed_min":"20","wait_minutes":"11","tip":"1.00"},
{"delivery_id":"y","dasher_id":"d1","accepted_min":"0","completed_min":"20","wait_minutes":"12","tip":"2.00"},
{"delivery_id":"z","dasher_id":"d1","accepted_min":"0","completed_min":"20","wait_minutes":"10","tip":"0.00"}
],
"promotions": [
{"rule_id":"G_C","type":"GUARANTEE","min_deliveries":"4","amount":"100.00"},
{"rule_id":"P_B","type":"PEAK","start_min":"5","end_min":"15","rate":"0.20","cap":"2.00"},
{"rule_id":"G_B","type":"GUARANTEE","min_deliveries":"3","amount":"20.00"},
{"rule_id":"P_A","type":"PEAK","start_min":"0","end_min":"20","rate":"0.10","cap":"3.00"},
{"rule_id":"G_A","type":"GUARANTEE","min_deliveries":"3","amount":"18.00"}
]
}[
{"dasher_id":"d1","base_pay":"12.00","wait_bonus":"0.60","tips":"3.00","adjustments":[{"rule_id":"P_A","amount":"3.00"},{"rule_id":"P_B","amount":"2.00"},{"rule_id":"G_A","amount":"0.40"},{"rule_id":"G_B","amount":"2.00"},{"rule_id":"G_C","amount":"0.00"}],"total_pay":"23.00"}
]20×2 = 40 minutes, so base pay is $12.00. Deliveries x and y exceed the wait threshold, earning $0.20 + $0.40 = $0.60. Both PEAK rules fire on overlapping work: P_A earns 40×$0.10 = $4.00, capped at $3.00; P_B earns 10×2×$0.20 = $4.00, capped at $2.00. Eligible earnings are $17.60. G_A adds $0.40 to reach $18.00, G_B adds $2.00 to reach $20.00, and G_C adds nothing because there are only three deliveries. Tips are excluded from both guarantee calculations and bring total pay to $23.00.Notes:0 <= accepted_min < completed_min <= 10^9, 0 <= start_min < end_min <= 10^9, and wait minutes do not exceed delivery duration.min_deliveries is a positive integer. There are no cancellations, duplicate records, time-zone conversions, or fractional minutes.None if the tree contains fewer than two live nodes.Function or class signatureTreeNode(val: int, left: Optional[TreeNode] = None, right: Optional[TreeNode] = None) — binary-tree node representation.max_live_node_path_sum(root: Optional[TreeNode]) -> Optional[int] — return the maximum valid path sum, or None when no valid path exists.root = [5, 2, -3, 4, -6, null, 7], using level-order serialization with null for missing children.5
/ \
2 -3
/ \ \
4 -6 7Output: 15Explanation: The live nodes are 4, -6, and 7. The best path is 4 → 2 → 5 → -3 → 7, with sum 4 + 2 + 5 - 3 + 7 = 15. The other two leaf-to-leaf paths have sums 0 and 5.Example 2:Input: root = [-5, -2, -3].-5
/ \
-2 -3Output: -10Explanation: There are exactly two live nodes, so the only valid path is -2 → -5 → -3. Returning -2 would be incorrect because a single node is not a path between two distinct live nodes.Constraints:0 and 200000 nodes.[-1000000000, 1000000000].O(n) time, where n is the number of nodes.O(n) time. If multiple paths tie, any one is acceptable. Explain how to avoid copying a complete path at every node.n x m representing a map where 1 represents an order location and 0 represents an empty space, implement a function maxDrivers(orders: List[List[int]], start: Tuple[int, int]) -> int that returns the maximum number of deliveries that can be assigned to drivers originating from start position.Example 1:orders = [[0,0,0],[0,1,0],[0,0,0]], start = (1, 1) 1 1 <= orders.length, orders[i].length <= 20 0 <= start[0] < orders.length 0 <= start[1] < orders[i].lengthmaxDeliveryTime(orders: List[int], k: int) -> int that returns the maximum possible delivery time over any sub-array of size k, where k is the number of concurrent deliveries.Example 1:orders = [2, 1, 3, 5, 6, 4], k = 3 14 [5, 6, 4], which yields a delivery time of 5 + 6 + 4 = 15.Constraints: 1 <= orders.length <= 100000 1 <= orders[i] <= 1000 1 <= k <= orders.lengthSign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free