Amazon·Data Scientist·Technical Phone Screen
- Given an orders table with a product category and sales amount, return the top 3 product categories by total sales for each calendar month. Ties should be broken by total sales descending, then category name alphabetically.
- For every customer, produce a result showing order ID, order date, amount, and a running cumulative total of that customer's spending ordered by order date.
- Classify each order as High (amount over 200), Medium (between 100 and 200 inclusive), or Low (everything else), then return the count of orders in each classification.
“I went straight for RANK() partitioned by month and ordered by sum descending, which was the right instinct.”