SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Slow Acceptance Hotspots

Unsolved

Uber's marketplace team wants to know where riders wait longest for a driver. trip_events logs a 'requested' event for every trip and an 'accepted' event when a driver accepts; trips that were never accepted have no 'accepted' event and are ignored. A trip is slow when more than 90 seconds pass between its requested and accepted events (exactly 90 seconds is not slow). Bucket slow trips by city and the hour of the request (0 to 23). Write an SQL query that returns the bucket or buckets with the most slow trips as city, request_hour and slow_trips. If several buckets tie for the most, return all of them. Order the results by city ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Uber

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM trip_events
Full source dataset
21 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine