Peak Concurrent Tokens
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L5
Problem
For every API token that has ever been issued, find the greatest number of concurrently active tokens during its lifetime and the first date that peak was reached. A token is active from its issued date until the day before its expiration; tokens with no expiration are considered still active. Return the token ID, peak concurrent count, and peak date.
Summary
How many tokens were alive at the same time?
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.