FreeCareerPath
Debug the CodebaseEasy

Fix: The Page That Skips Rows

An API paginates results with a cursor. Users report that occasionally a record they know exists never appears on any page — and sometimes one appears twice. `paginate(rows, cursor, limit)` returns `(page, next_cursor)`. Rows are sorted by `id` ascending and ids are unique. `cursor` is `None` for the first page, otherwise the id to continue after. `next_cursor` is `None` when there are no more rows. Find the bug and fix it.

What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.

Log in to start this session

Timed sessions and your results for "Fix: The Page That Skips Rows" are saved to your account — logging in takes a few seconds.

Fix: The Page That Skips Rows — FreeCareerPath