Top Product Category by Transactions

A medium 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
medium
Seniority
L4

Interview Prompt

Our all-time category leaderboard crowns a single winner and hides how the lead has changed hands from year to year. For each recent year in `transactions`, show the year, the `products` category with the most purchases that year and its purchase count.

Summary

Organic purchases, no marketing nudge. Which category wins?

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