The Month-by-Month Snapshot
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given a list of sales records (each a dict with 'employee_id', 'month', 'sales_amount'), return a list of per-employee dicts. Each dict has 'employee_id' plus keys named after each month (as seen in the input) holding the total sales for that month for that employee. Employees are sorted alphabetically by employee_id.
Summary
Every salesperson has a story. The months just tell it sideways.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.