Loading...

Service Uptime Minutes

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

Domain
SQL
Difficulty
medium
Seniority
senior

Problem

Each alert has a fired_at timestamp and a resolved timestamp (NULL if still open). For each service, calculate the total minutes spent in an active alert state. Only consider alerts that were resolved within the first year after the service's earliest health check.

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.