Search ⌘K
Uber
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...

Analytics Reporting Track
Hard
35 min
query basics
aggregation
date functions

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

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.

Prereq: query basics
Prereq: filtering
Prereq: aggregation
Prereq: date functions

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 INT
trip_date DATE
trip_status VARCHAR(20
driver_idtrip_datetrip_status
102024-05-01delayed
102024-05-02delayed
102024-05-03on_time
102024-05-04delayed
202024-05-01delayed
202024-05-02delayed
202024-05-03delayed
202024-05-05delayed
302024-05-01on_time
302024-05-02delayed
Editor
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.