Log inBook a Demo
BuildMidBackendAuto-graded

Fix pagination that skips records with tied timestamps

Paging through a long list without losing or repeating a record, even when entries share a timestamp, takes care.The /records endpoint pages through a dataset ordered by timestamp then id, and its cursor remembers only the last timestamp it saw, asking next for everything strictly later. The dataset contains records created in the same second. So whenever a page boundary falls inside a group of tied timestamps, the records on the wrong side are silently skipped — they never appear in any page. Fix the cursor so a full walk returns the dataset exactly.
30 min
python

You're done when

  • The full walk returns exactly the dataset — nothing skipped, nothing duplicated.

What it measures

API designDesigning a cursor that encodes enough of the sort key to resume unambiguously.
Algorithm designReasoning about ties in a composite ordering and where a boundary can legitimately fall.
Detecting silent data lossRecognising a bug whose symptom is missing rows nobody notices, and verifying by comparing a full walk against the source.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

30 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo