PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Armada

Fetch paginated data from two APIs

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competency in robust API retrieval, pagination handling, defensive data validation, and joining records across endpoints while preserving the order of source records and safely handling missing or malformed fields.

  • medium
  • Armada
  • Coding & Algorithms
  • Software Engineer

Fetch paginated data from two APIs

Company: Armada

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Write a function `get_enriched_records(api_a_url, api_b_url)`. `api_a_url` returns paginated JSON in the form: ```json { "data": [ {"id": 1, "ref_id": "x1"}, {"id": 2, "ref_id": "x2"} ], "next_page": 2 } ``` `api_b_url` returns paginated JSON in the form: ```json { "data": [ {"ref_id": "x1", "target_field": "value1"}, {"ref_id": "x2", "target_field": "value2"} ], "next_page": null } ``` Implement the function so that it: 1. Retrieves **all pages** from both APIs. 2. Joins the records from the two endpoints using `ref_id`. 3. Returns a list of objects in the form `{ "id": <id>, "target_field": <value> }`. 4. Preserves the order of records from `api_a_url`. 5. Skips any record if: - `ref_id` is missing, - the matching record does not exist in the second API, - `target_field` is `null`, an empty string, or whitespace-only. 6. Handles missing keys, empty pages, and `None` values safely without crashing. 7. Uses normal HTTP request handling; assume the test harness will mock the API responses. The focus is not on advanced algorithms, but on clean API retrieval logic, pagination handling, and defensive data validation.

Quick Answer: This question evaluates a candidate's competency in robust API retrieval, pagination handling, defensive data validation, and joining records across endpoints while preserving the order of source records and safely handling missing or malformed fields.

Armada logo
Armada
Feb 17, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
2
0

Write a function get_enriched_records(api_a_url, api_b_url).

api_a_url returns paginated JSON in the form:

{
  "data": [
    {"id": 1, "ref_id": "x1"},
    {"id": 2, "ref_id": "x2"}
  ],
  "next_page": 2
}

api_b_url returns paginated JSON in the form:

{
  "data": [
    {"ref_id": "x1", "target_field": "value1"},
    {"ref_id": "x2", "target_field": "value2"}
  ],
  "next_page": null
}

Implement the function so that it:

  1. Retrieves all pages from both APIs.
  2. Joins the records from the two endpoints using ref_id .
  3. Returns a list of objects in the form { "id": <id>, "target_field": <value> } .
  4. Preserves the order of records from api_a_url .
  5. Skips any record if:
    • ref_id is missing,
    • the matching record does not exist in the second API,
    • target_field is null , an empty string, or whitespace-only.
  6. Handles missing keys, empty pages, and None values safely without crashing.
  7. Uses normal HTTP request handling; assume the test harness will mock the API responses.

The focus is not on advanced algorithms, but on clean API retrieval logic, pagination handling, and defensive data validation.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Armada•More Software Engineer•Armada Software Engineer•Armada Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ 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.