HHubSpot·DSASWE-2Technical Phone Screen
API Calls: Fetch, Parse, and Compute
Problem
Given a paginated API, fetch all pages, parse the data, and compute an aggregate (e.g., total or average across records).
Example
GET /data?page=N until empty -> compute average value
Constraints
- Handle pagination and transient errors
Approach
Loop pages until exhausted; retry on failure; aggregate. HubSpot's practical coding flavor.
added 6 days ago