The Email Ranker
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L3
Problem
Given a list of activity records (each a dict with 'user_id' and 'action'), count activities per user_id. Rank users using dense ranking by activity count descending, with ties broken by user_id alphabetically ascending. Return a list of dicts with keys 'user_id', 'activity_count', 'rank' in rank order.
Summary
Some inboxes see more action.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.