PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Data Manipulation (SQL/Python)/Millennium Management

Implement paginated API ingestion

Last updated: Mar 29, 2026

Quick Overview

This question evaluates skills in API integration, paginated data ingestion, error handling with retries and exponential backoff, rate limiting, streaming CSV serialization without holding all records in memory, schema normalization, unit testing, and time/space complexity analysis.

  • Medium
  • Millennium Management
  • Data Manipulation (SQL/Python)
  • Software Engineer

Implement paginated API ingestion

Company: Millennium Management

Role: Software Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Take-home Project

You are given a REST endpoint GET /orders?page=1&limit=100 that returns JSON objects of the form { "page": n, "per_page": m, "total_pages": T, "data": [ ... ] }. Implement a function fetch_all_orders(base_url, limit, since=None, out_stream) that: ( 1) retrieves every page until total_pages is exhausted; ( 2) flattens each record into the schema: id (string), created_at (UTC ISO 8601), amount_cents (int), customer_id (string), customer_email (string); ( 3) handles HTTP errors and rate limiting by retrying 429 and 5xx responses with exponential backoff and jitter, up to a configurable max_retries; ( 4) respects a rate limit of 10 requests/second; ( 5) supports since to fetch only records with created_at >= since; and ( 6) writes results to CSV in stable order (ascending created_at, then id) without holding all records in memory. Provide unit tests for pagination boundaries, retry behavior, and schema parsing. Finally, discuss time and space complexity, and how you would adapt the approach for cursor-based pagination where the server returns a next cursor token instead of total_pages.

Quick Answer: This question evaluates skills in API integration, paginated data ingestion, error handling with retries and exponential backoff, rate limiting, streaming CSV serialization without holding all records in memory, schema normalization, unit testing, and time/space complexity analysis.

Millennium Management logo
Millennium Management
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Data Manipulation (SQL/Python)
6
0

You are given a REST endpoint GET /orders?page=1&limit=100 that returns JSON objects of the form { "page": n, "per_page": m, "total_pages": T, "data": [ ... ] }. Implement a function fetch_all_orders(base_url, limit, since=None, out_stream) that: (

  1. retrieves every page until total_pages is exhausted; (
  2. flattens each record into the schema: id (string), created_at (UTC ISO 8601), amount_cents (int), customer_id (string), customer_email (string); (
  3. handles HTTP errors and rate limiting by retrying 429 and 5xx responses with exponential backoff and jitter, up to a configurable max_retries; (
  4. respects a rate limit of 10 requests/second; (
  5. supports since to fetch only records with created_at >= since; and (
  6. writes results to CSV in stable order (ascending created_at, then id) without holding all records in memory. Provide unit tests for pagination boundaries, retry behavior, and schema parsing. Finally, discuss time and space complexity, and how you would adapt the approach for cursor-based pagination where the server returns a next cursor token instead of total_pages.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Millennium Management•More Software Engineer•Millennium Management Software Engineer•Millennium Management Data Manipulation (SQL/Python)•Software Engineer Data Manipulation (SQL/Python)
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.