Data & Systems45 minutes

Document Revisions

Implement optimistic concurrency.

Task

Build a document editor that creates, updates, and deletes documents without silently overwriting a newer revision.

Requirements

  1. Return {documents, error}. Error is null or one of exists, missing, conflict, invalid.
  2. create requires a new nonempty id and a nonblank title; body is a string. Create a document with version 1.
  3. update and delete require an existing id and an exact expectedVersion. Reject stale versions with conflict.
  4. update replaces title and body and increases version by 1. delete removes only that document. Preserve list order, return unchanged documents on errors, and never mutate input.
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

Two editors can change the same document, and today the second save silently wins. Use the AI assistant as you would at work. I will be watching how you check that a stale edit is really rejected, not just that the happy path works.

  • 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?
  • Where did the assistant's first version of the replay rule go wrong, if anywhere, and how did you notice?
  • How would a database enforce the version check and the replay rule atomically?
  • What should the user see when their retry turns out to be a conflict?