Sign in to track progress, unlock prep layers, and browse your pipeline.Sign in
Fetch, group, and print paginated activities
Problem Description
Implement a system to fetch, process, and display activity data from a paginated API.
Requirements
-
Fetch All Activities:
- Consume a paginated API endpoint that returns a
totalCountand an array ofactivitiesfor a given page. - Iterate through all available pages to retrieve every activity.
- Initially, print each activity as it is fetched.
- Consume a paginated API endpoint that returns a
-
Group Activities:
- After all activities have been fetched, group them into logical "clumps".
- Each clump must contain activities that share the exact same
typeandname. - Define a
Clumpclass with the following attributes: a list ofactivities,type, andname. - The final output of this grouping step should be a collection of these
Clumpobjects.
-
Enrich User Data:
- For each activity, replace the
userIdwith the corresponding user'sname. - The user's name must be retrieved by calling a separate
getUserName(userId)API endpoint.
- For each activity, replace the
AI interview prep
Core dilemma
Efficiently fetching and processing data from multiple external APIs, balancing concurrency, rate limits, and data consistency for a potentially large volume of requests.
Mid-level signals3
Senior signals3
Red flags3
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Fetch, group, and print paginated activities
Problem Description
Implement a system to fetch, process, and display activity data from a paginated API.
Requirements
-
Fetch All Activities:
- Consume a paginated API endpoint that returns a
totalCountand an array ofactivitiesfor a given page. - Iterate through all available pages to retrieve every activity.
- Initially, print each activity as it is fetched.
- Consume a paginated API endpoint that returns a
-
Group Activities:
- After all activities have been fetched, group them into logical "clumps".
- Each clump must contain activities that share the exact same
typeandname. - Define a
Clumpclass with the following attributes: a list ofactivities,type, andname. - The final output of this grouping step should be a collection of these
Clumpobjects.
-
Enrich User Data:
- For each activity, replace the
userIdwith the corresponding user'sname. - The user's name must be retrieved by calling a separate
getUserName(userId)API endpoint.
- For each activity, replace the