Loading...

Top 2 Busiest API Slots

A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
medium
Seniority
mid, senior

Problem

Segment each day's API traffic into 'Morning' (before 12:00), 'Early Afternoon' (12:00 to 15:00), and 'Late Afternoon' (after 15:00). Find the top 2 day-plus-time-segment combinations by total API calls; if there's a tie, include all tied results. Exclude records with missing timestamps.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.