The Long Way Back
A hard SQL mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L5
Interview Prompt
From our service health checks we track each service's average uptime for each calendar month. Reading one service's months in order, a slump is a run of months each lower than the month before and a recovery is a run of months each higher than the month before; pair every slump with the recoveries that come after it, reporting the service, the month the slump began, the month the recovery began, and the recovery's length divided by the slump's as a decimal.
Summary
Some services fell apart and clawed their way back. Find them, and measure the climb.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write and run your SQL against a real database
- Answer the interviewer's follow-up questions, then get a hire or no-hire decision