This question evaluates the ability to consume paginated APIs, aggregate and transform results (including mapping user IDs to user names), design a simple domain class for grouping, and implement grouping logic by type and name, testing skills in API interaction, data modeling, and data processing within the Coding & Algorithms domain.
Given a paginated API that returns (totalCount, activities[]) for a requested page, implement code that iterates through all pages and prints every activity. After fetching all activities, group them into clumps where each clump contains activities sharing the same type and name. Implement a Clump class with attributes: activities list, type, and name, and return the clumps. Update the output so each activity shows the user’s name (retrieved from a separate getUserName(userId) API) instead of the user ID.