Top Products per Category
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
We run a retail catalog where sales sit in a transactions table and the item details sit in a products table. For each product category, pull the top 5 products by total sales revenue, returning the category, the product name, and the total sales.
Summary
Five winners per category.
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