Case study interview followed by SQL live coding at DoorDash USA.
For the SQL portion, use the provided markets and deliveries tables to report observed market-months from Q1 2025. Return completed-delivery counts, average duration for completed deliveries, and each market's rank within its month; retain observed market-months with zero completed deliveries.
market_name, month_start, completed_deliveries, avg_duration_minutes, and market_rankmonth_start, market_rank, then market_name| Column | Type | Description |
|---|---|---|
| market_idPK | INT | Unique market identifier |
| market_name | VARCHAR(100) | Display name of the market |
| Column | Type | Description |
|---|---|---|
| delivery_idPK | INT | Unique delivery identifier |
| market_id | INT | Market associated with the delivery |
| status | VARCHAR(20) | Delivery outcome |
| placed_at | TIMESTAMP | Timestamp when the delivery was placed |
| delivered_at | TIMESTAMP | Timestamp when the delivery was completed |