DA0-002 Data Acquisition and Preparation Practice Question
A data engineer is extracting data from a REST API that returns JSON. The API paginates results with a 'next_page' token. The engineer needs to load all pages into a database. Which approach should the engineer use to ensure all data is acquired?
⚠ Common exam trap
The trap here is assuming that a single large request can bypass pagination, but APIs enforce limits and pagination tokens must be followed sequentially.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a while loop that continues to call the API with the 'next_page' token until the token is null, parsing and loading each page.
Following the 'next_page' token in a loop until it is null is the correct way to handle API pagination. This ensures that every page is requested and processed, resulting in a complete dataset. It also respects the API's design and any rate limits.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a while loop that continues to call the API with the 'next_page' token until the token is null, parsing and loading each page.
Why this is correct
Pagination tokens are designed to be followed sequentially until no more pages remain. A while loop that checks for a null token ensures all pages are retrieved. This is the standard method for consuming paginated APIs and guarantees complete data extraction.
- ✗
Send parallel requests for each page number until an empty response is received.
Why it's wrong here
Parallel requests can cause issues if the API rate limits or if page numbers are not sequential. Without knowing the total pages, this approach may miss pages or cause errors. It also does not use the provided 'next_page' token, which is the intended method.
- ✗
Make a single API call with a large 'limit' parameter to retrieve all records at once.
Why it's wrong here
Many APIs cap the maximum limit per request, so a single call may not return all records. Additionally, large responses can cause timeouts or memory issues. Relying on a single call is unreliable and may miss data if the API enforces pagination.
- ✗
Use the 'next_page' token as a query parameter in a single request to retrieve all subsequent pages.
Why it's wrong here
The 'next_page' token is typically used to fetch the next page only, not all subsequent pages. APIs do not usually support fetching multiple pages with one token. This approach misunderstands the purpose of the token and would not retrieve all data.
Go deeper
Related to this question
About these practice questions
One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.