Analyze Recent Orders Dataset with Python/pandas
Company: Roblox
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Onsite
Overview: This question evaluates proficiency in data manipulation and aggregation using Python/pandas, including extracting per-user maximums, computing overall summary statistics, and producing daily aggregates from time-stamped records.
Max-priced order per user
Tables
orders(order_id INTEGER, user_id INTEGER, price DECIMAL(10,2), created_at DATE)
Hints
- Use ROW_NUMBER() partitioned by user_id
- Order by price DESC and tie-break by date then order_id
Overall average order price
Tables
orders(order_id INTEGER, user_id INTEGER, price DECIMAL(10,2), created_at DATE)
Hints
- Use the AVG aggregate over the price column
Daily totals and average price
Tables
orders(order_id INTEGER, user_id INTEGER, price DECIMAL(10,2), created_at DATE)
Hints
- Group by created_at to aggregate per day
- COUNT(*) for totals and AVG(price) for average