← Cresta Interview Insights

Cresta·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

Cresta SWE round that was basically a live coding exercise around HTTP and data wrangling. The problem itself wasn't algorithmically hard but there were enough moving parts that I had to stay organized. Left feeling okay but not great.

Questions Asked (1)

Q1

Write a function that calls the Wikipedia REST API, filters the results based on a criterion given during the interview, aggregates the filtered data, and returns the result. Also discuss error handling, rate limiting, and pagination.

API & IntegrationsTechnical Trade-offsSystem Design
Author's notes

The filtering criterion gets revealed mid-round which I wasn't expecting, so you can't really prep a specific solution.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the filtering criterion and expected output format, then outline a modular design: a fetch function with pagination and rate-limit handling, a filter function, and an aggregation function. Discuss trade-offs around error handling (retries, backoff) and rate limiting (client-side throttling, caching) before writing pseudocode.

Pro tip: Proactively mention that you would use the MediaWiki API's 'continue' parameter for pagination and respect the 'Retry-After' header for rate limiting—this shows you've actually worked with Wikipedia's API and understand production concerns.

1. Clarify requirements and constraints

Ask about the specific filter criterion, expected data shape, and whether the function should handle large result sets. Confirm if the Wikipedia REST API is the right endpoint or if the MediaWiki Action API is more suitable.

2. Design the fetch layer with pagination and rate limiting

Outline a function that makes HTTP requests with proper headers (User-Agent), handles pagination via continuation tokens, and implements rate limiting using a token bucket or exponential backoff on 429 responses.

3. Implement filtering and aggregation

Describe how to apply the filter criterion to each item, then aggregate the filtered results (e.g., sum, count, group by). Mention using functional programming constructs like map/filter/reduce for clarity.

4. Add robust error handling

Discuss handling network errors, HTTP status codes (4xx vs 5xx), timeouts, and malformed responses. Suggest retry logic with exponential backoff and jitter for transient failures.

5. Discuss trade-offs and optimizations

Talk about caching responses to reduce API calls, using async/await for concurrency, and the trade-off between fetching all pages upfront vs. streaming. Mention testing with mocks and edge cases.

Key Points to Mention

  • Use of the MediaWiki API's 'continue' parameter for pagination and handling of 'batchcomplete'.
  • Rate limiting strategies: client-side throttling, exponential backoff with jitter, and respecting 'Retry-After' headers.
  • Error handling: distinguishing between retryable (5xx, timeouts) and non-retryable (4xx) errors, and implementing retries with backoff.
  • Aggregation techniques: using reduce or group-by operations, and considering memory constraints for large datasets.
  • Caching: storing responses or ETags to avoid redundant requests and reduce load on the API.
  • Testing: mocking HTTP responses, simulating rate limits and errors, and verifying pagination logic.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.