Uber
Analytics Reporting Track · Hard · 35 min
Consecutive Delay Streaks
Dispatch wants the longest streak of delayed service days for each driver. Return driver_id and longest_streak, where a streak counts consecutive trip_date v...
Company labels are directional practice context, not official interview guidance.
Objective
Practice query basics through a Uber-tagged business scenario.
Approach
Use this track to train on SQL that mirrors day-to-day analytics workflows and recurring reporting asks.
Company context
Company labels are directional practice context, not official interview guidance.
Dispatch wants the longest streak of delayed service days for each driver. Return driver_id and longest_streak, where a streak counts consecutive trip_date values with trip_status = delayed. Sort by driver_id.
ride_status_log
| driver_id | trip_date | trip_status |
|---|---|---|
| 10 | 2024-05-01 | delayed |
| 10 | 2024-05-02 | delayed |
| 10 | 2024-05-03 | on_time |
| 10 | 2024-05-04 | delayed |
| 20 | 2024-05-01 | delayed |
| 20 | 2024-05-02 | delayed |
| 20 | 2024-05-03 | delayed |
| 20 | 2024-05-05 | delayed |
| 30 | 2024-05-01 | on_time |
| 30 | 2024-05-02 | delayed |
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.