Loading...

Successful Call Volume per Endpoint

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

Domain
SQL
Difficulty
medium
Seniority
senior

Problem

The API gateway logs duplicate events from retry middleware. In the api_calls table, duplicate rows share the same user_id, endpoint, and call_time. Keep only the row with the lowest call_id from each duplicate group. After deduplication, find the total number of successful calls per endpoint. A successful call has status equal to 200. Return each endpoint and its successful call count, ordered from most to fewest.

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.