Select Top Customers Using Transaction Data Filters
Company: Amazon
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Technical Screen
Overview: This question evaluates a candidate's ability to perform data aggregation, filtering, ranking, and deterministic tie-breaking on transactional datasets, assessing skills in Data Manipulation (SQL/Python).
Tables
transactions(id INTEGER, user_id INTEGER, order_date DATE, amount DECIMAL(10,2))
Hints
- Filter transactions to 2023 with amount >= 100 before aggregating.
- Aggregate per user_id and use ROW_NUMBER() with the specified ordering to deterministically select the top five.