DoorDash
Foundations Track · Easy · 15 min
Stockout Days by Warehouse
The inventory team wants to know which warehouses experienced stockouts in July 2024. Return warehouse_id and the number of stockout_days where units_on_hand...
Company labels are directional practice context, not official interview guidance.
Objective
Practice query basics through a DoorDash-tagged business scenario.
Approach
Use this track to lock in clean query structure, basic filtering logic, and confidence with grouped output.
Company context
Company labels are directional practice context, not official interview guidance.
The inventory team wants to know which warehouses experienced stockouts in July 2024. Return warehouse_id and the number of stockout_days where units_on_hand was zero. Show only warehouses with at least one stockout day. Sort by stockout_days descending, then warehouse_id.
inventory_snapshots
| warehouse_id | snapshot_date | units_on_hand |
|---|---|---|
| 1 | 2024-07-01 | 14 |
| 1 | 2024-07-02 | 0 |
| 1 | 2024-07-03 | 0 |
| 2 | 2024-07-01 | 8 |
| 2 | 2024-07-02 | 5 |
| 3 | 2024-07-01 | 0 |
| 3 | 2024-07-02 | 7 |
SQL workspace
Run queries against the protected question data, then submit once the result shape looks right.
Sign in to run SQL
Create a free account or sign in before running queries against protected question data.