The scenario
Repair transaction cursors, compare amount-pagination designs, analyze a database timeout, and review a proposed cache. The runnable in-memory optimization is an additional practice task. This original nrml exercise follows community reports about Coinbase; it is not an official interview question.
A failure to reason about
Transactions A and B share timestamp 10. With a page size of one, continuing after A must still return B. Ordering by amount can produce a different first page.
Illustrative context for the topic. The exercise’s full requirements arrive in the workspace.
Questions to bring to your review
- What must a continuation preserve when several transactions share a timestamp?
- How can amount ordering coexist with existing timestamp cursors?
- Why might amount-sorted requests time out despite an index supporting timestamp order?
- Can a cached page remain valid when the requested page size or sort changes?
Skills you will practice
- cursor pagination
- backward compatibility
- API design
- code review
- testing
- performance diagnosis
Read the existing code, reproduce the reported behavior, review proposed changes, and verify your final implementation. You can use AI assistance while staying responsible for the result.
Prepare with a worked example
- How to review AI-generated code in an interview
Work through a flawed AI patch, design a regression that exposes it, and explain a repair with evidence. A practical code-review exercise for AI-assisted interviews.
- How to approach an AI-assisted coding interview
A practical walkthrough of an AI-assisted coding interview: understand the repository, direct the assistant, verify a change, and explain your decisions.
See how nrml evaluates an attempt, including the limits of automated evidence.