Data & Systems40 minutes

Pagination Pull Request

Review an AI-written pull request for cursor pagination and fix its blocking problems.

JavaScript

Task

A teammate used an AI assistant to add cursor pagination to the orders list of a support tool, and asked you to review the pull request. The code is short and its own tests pass. Read it against the endpoint contract, write your review comments in order of severity, and fix the problems that should block the merge.

Requirements

  1. The checks call fetchPages(orders, query, options), a small client that is supplied. It requests a page, follows nextCursor for up to options.maxPages pages, and returns {status, pages, hasMore}: the order ids of every page and the hasMore flag of every page. It calls listOrders(orders, query), which you are reviewing. Do not change the arguments.
  2. listOrders returns {status: 200, body: {items, nextCursor, hasMore}}. Items are whole orders, newest first. Orders created in the same instant are ordered by id, largest first. query.status, when present, keeps only orders with that status.
  3. Query values are strings. limit is the page size: a missing limit, or one that is not a number, means 20. Any other value is clamped to the range 1 to 100.
  4. hasMore is true only when at least one more order follows this page, and nextCursor is null when hasMore is false. A cursor is opaque to the client.
  5. A client that follows nextCursor to the end sees every matching order exactly once. Orders that are added or deleted while it pages do not make another order repeat or go missing.
  6. Write your review comments in REVIEW.md, most severe first, and fix the blocking ones in orders/list.js.
How you are graded
  • Decomposition 15%
  • Prompting the assistant 15%
  • Verification 20%
  • Judgment about AI output 15%
  • Correctness 25%
  • Communication 10%

Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard

Interview guidance

A teammate used an assistant to add cursor pagination to the orders list, and wants to merge today. Review the pull request. Rank your comments by severity, then fix the ones that should block the merge. Use the AI assistant however you like, but the review is yours. Before you change any code, tell me your most severe comment and the input that shows it.

  • AI is allowed and expected: your own Claude, OpenAI or Gemini key, or the free in-browser model.
  • You are graded on how you drive and check the AI, not on how much you prompt.
  • Run the checks; read what fails.
  • A new requirement will arrive partway through.
  • Too little AI use is reported as “not enough to grade”, never as a fail.
You will answer 7 debrief questions at the end
  • What did you delegate to the AI, and why?
  • Name one AI suggestion you rejected or changed, and why.
  • Choose one block the AI helped write. Explain what each line does and which test verifies it.
  • What is still risky, and what would you test or ship next?
  • What was your most severe comment, and what input convinced you it was real?
  • Name one thing the assistant flagged that you decided was not a problem. How did you check?
  • The pull request's own tests all passed. What kind of test was missing, and how would you ask a teammate to add it?