Medium · 20 min
Identify the top 5 highest-earning employees by total compensation (salary + bonuses) in the last 12 months. Rank them within their department and compare to the department average. Return employee_id, name, department, total_compensation, dept_rank, dept_avg, vs_dept_avg.
Tables: employees, payments
Medium–Hard · 25 min
Identify duplicate/repeated payments within the same customer account in a 5-minute window. A duplicate is same customer, same amount, same currency. Flag each payment as 'original' or 'duplicate' and track its occurrence number. Return payment_id, customer_id, amount, currency, created_at, payment_type, occurrence_number.
Tables: payments
Hard · 30 min
For each merchant and day, calculate the rolling 3-day sum of earnings and the rolling average of the previous 7 days (excluding the current day). Flag any day where the daily total dropped 50%+ from the 7-day rolling average. Return transaction_date, merchant_id, merchant_name, category, daily_total, rolling_3day_sum, rolling_7day_avg_prior, large_drop_flag.
Tables: transactions, merchants