Code RoomLive feed pagination spec
MediumPrep Room Coding #4157

Live feed pagination spec

Vibe & agenticNetworking & APIsMid–Senior~18 min

You're asking an AI agent to add pagination to a Go REST endpoint that lists a feed of events ordered by creation time, where rows are constantly being inserted and deleted. Write the spec that produces correct, stable pagination at scale. What pagination model, ordering, and acceptance criteria do you require, and what must the cursor encode? Then describe what a naive prompt ('add pagination with page and limit') produces that breaks on a live feed.

Implement
keyset_page_ids(rows: list[str], cursor: str, page_size: int) → list[str]
Examples
in[["2026-01-01T00:00:00Z|e03","2026-01-01T00:00:00Z|e01","2026-01-02T00:00:00Z|e02"],"",2]out["e02","e03"]
in[["2026-01-01T00:00:00Z|e03","2026-01-01T00:00:00Z|e01","2026-01-02T00:00:00Z|e02"],"2026-01-01T00:00:00Z|e03",2]out["e01"]
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 18 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.