Code RoomPagination cursor not advancing
MediumPrep Room Coding #4060

Pagination cursor not advancing

Vibe & agenticNetworking & APIsMid–Senior~16 min

An AI agent generated this Python client to pull all charges from a paginated REST API (cursor-based, returns `has_more` and `next_cursor`). It returns the right data for accounts with a single page but silently drops records for large accounts.

What is broken, and what else is missing for production use?

Implement
fetch_all_charges(pages: list[str], max_pages: int) → list[str]
Examples
in[["start;c1,c2;p2","p2;c3,c4;p3","p3;c5;"],10]out["c1","c2","c3","c4","c5"]
in[["start;c1,c2;start"],10]out["c1","c2"]
in[[],10]out[]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 16 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.