The Paginated REST API Aggregation Task
Handle the paginated REST API aggregation task in the Palantir FDSE screen and produce totals that are exact rather than just plausible. Validate each response, follow opaque cursors under a snapshot until the final page, deduplicate records by identity while flagging conflicting versions, and apply a fixed half-open time window normalized to UTC. Retry only transient failures, reject partial aggregates, and test your paginator with scripted responses rather than a live endpoint.
We'll cover the following...
- What must you know before calling /adjustments?
- What does a 200 response let you trust?
- Which request comes next, and when do you stop?
- How do three pages become one regional aggregate?
- What if c2 fails after North already has 120 cents?
- Does the final cursor prove a stable dataset?
- What evidence distinguishes a working paginator?
GET /adjustments returns records in pages. The requested answer is regional counts and amounts for unique adjustments updated during a fixed week.
Before requesting data, establish which records qualify, how continuation works, and when the answer is complete. A plausible first-page total is only provisional.
Return an exact aggregate only after every required page has been retrieved and validated under the required consistency guarantee.
What must you know before calling /adjustments?
Public preparation guides describe paginated JSON retrieval and aggregation as possible technical-screen content; these accounts establish neither a universal Palantir format nor an official question. A candidate-report compilation also describes filtering paginated records by recent updates and discussing failures. The endpoint and fixtures here are course-authored preparation.
For this task, agree on the following contract:
Call
GET /adjustments, initially without parameters. Subsequent requests acceptcursorandsnapshot.Every successful response contains
snapshot,records, andnext_cursor. The server documents that a snapshot binds continuation requests to one immutable view.Group eligible unique adjustments by
region, returningcountandamount_cents. Include only regions with eligible adjustments.Freeze the interval before retrieval:
[2026-10-21T00:00:00Z, 2026-10-28T00:00:00Z). Include the lower bound; exclude the upper bound.Identity is
id. Ignore repeats whose required fields are identical after timestamp normalization; reject conflicting versions of the same identity.Any unrecoverable retrieval, validation, or consistency failure raises an error. No partial aggregate is returned.
The previous lesson established a trustworthy aggregation grain. Here that grain is one unique adjustment, and retrieval must establish the input population before its totals become final.
What does a 200 response let you trust?
An HTTP request specifies a method, target, parameters, and possibly headers or a body. Its response contains a status, headers, and a body. For example, a continuation request has method GET, target /adjustments, URL-encoded query parameters cursor=c2&snapshot=s7, and an Accept: application/json header.
A response with status 200 and Content-Type: application/json might contain:
{"snapshot":"s7","records":[],"next_cursor":"c3"}
This is a valid empty page that still requires continuation. Three checks establish different things:
HTTP status: This endpoint accepts
200only.JSON parsing: The body must be syntactically valid JSON.
Application validation: The parsed value must satisfy the endpoint’s field and business rules.
Require an object with a nonempty string snapshot, a list records, and next_cursor equal to either null or a nonempty string. Each record must be an object containing:
idandregion: Nonempty strings.amount_cents: A nonnegative integer, explicitly excluding Booleans. Python treatsbool...