Market GOV and Dasher Reassignment Rate Without Join Fan-Out
Last updated: November 29, 2026
Quick Overview
Given orders, order_items and a dasher_assignments log that can contain duplicate rows, compute per market the order count, gross order value, average number of Dashers offered each order, reassignment rate, and average minutes to acceptance, without double counting.
DoorDash
November 29, 20260
0
0 solved
Given orders, order_items and a dasher_assignments log that can contain duplicate rows, compute per market the order count, gross order value, average number of Dashers offered each order, reassignment rate, and average minutes to acceptance, without double counting.
DoorDash logistics DS work joins the order, cart and dispatch tables constantly, and the classic mistake is joining two one-to-many tables to orders at once and inflating GOV. This onsite question checks whether you notice the fan-out, pre-aggregate each child table to the order grain, and dedupe a noisy dispatch log.
What the Interviewer Expects
- Identify the grain of each table before joining
- Pre-aggregate order_items and dasher_assignments to one row per order
- Deduplicate repeated assignment log rows
- Use LEFT JOINs so orders with no assignment rows still count
- Define reassignment rate and time to accept explicitly
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you show that the naive three-table join inflates GOV, using a quick query?
- How would you compute the 90th percentile minutes to accept per market?
- What if an order is accepted, then unassigned, then accepted by a second Dasher? Which acceptance time do you report?
- How would you attribute reassignment to merchant delay versus Dasher declines?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
orders(order_id, market, created_at) is one row per order. order_items(order_id, item_id, quantity, unit_price) is many per order. dasher_assignments(order_id, dasher_id, offered_at, response) i...
Approach
Joining both child tables directly to orders multiplies rows: an order with 3 items and 2 offers becomes 6 rows, so every item line appears twice and SUM(quantity * unit_price) doubles GOV. Fix it b...