There's a sales table with the columns product_id, category, amount, and sold_at. Write a SQL query that, for each category, returns the three products with the highest revenue over the last thirty days, with the revenue total and the rank within the category.
~15 min by voice
How to approach it
They're checking whether you understand SQL's order of execution (WHERE → GROUP BY → windows → outer filter), whether you can aggregate first and rank afterwards, and whether you deal deliberately with equal revenue and an index-friendly date filter.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.