Yesterday's Crown

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
L4

Interview Prompt

A cloud cost dashboard shows, for each billing day, which service spent the most the day before, where a service's spend on a day is the total of its charges that day. Return each billing day with that prior-day top service, its spend, and the prior day's total spend across all services.

Summary

Every dawn inherits the spending of the day before.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write and run your SQL against a real database
  4. Answer the interviewer's follow-up questions, then get a hire or no-hire decision