Top 3 Weekday Power Users
Problem
**[Asked at Amazon]**
Amazon wants to identify power users: people who interact most with the platform
on **weekdays** (Monday–Friday only). Weekend activity is excluded because it
reflects personal browsing, not work-related usage patterns.
Count each user's total events on weekdays. Return the top 3 users by event count,
showing `user_id` and `weekday_events`. Order by count descending, then user_id ascending
to break ties.
Tables
Example rows — the live problem includes the full dataset.
| event_id | user_id | event_type | event_date |
|---|
Expected output
Your answer should return 3 rows with the columns user_id, weekday_events.
Starter code (SQL)
SELECT *
FROM user_events;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock