Loading...

The Response Aggregator

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
junior, mid

Problem

Our data pipeline fetches paginated API responses. Write a function called aggregate_pages that takes a list of page results, where each page is a list of dictionaries with 'category' and 'amount' keys. Combine all pages and return a dictionary mapping each category to its total amount, sorted by total descending.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.