Fetch and aggregate paginated team data via API
Company: Reevo
Role: Software Engineer
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Take-home Project
Implement a function getTopTeams(baseUrl, n) that calls a paginated HTTP API returning a JSON array of team objects on each page: [{"name": string, "wins": integer}]. Pagination is controlled by appending &page=<number> to baseUrl (pages start at 1 and continue until an empty or missing page is encountered). Retrieve and merge all pages, sort teams by wins descending then name ascending, and return the top n team names. Handle pagination, transient network errors (with retries/backoff), rate limits, and malformed records.
Quick Answer: This question evaluates API integration, pagination handling, robust error handling (retries/backoff and rate-limit awareness), data aggregation, sorting and top‑N selection skills within the Data Manipulation (SQL/Python) domain.