All practice tasks

Coding (Platform)

Optimistic workflow journal

express + react · Hard · offline sync

A browser and API disagree at the optimistic workflow journal boundary. A board supports several rapid card moves. When one request fails, the current implementation restores the entire old board and erases later confirmed moves.

Task

Repair the shared browser-to-service contract. Reconcile move intents independently so failure restores only the affected intent while later confirmed order remains.

Contract

Input is {initialIds,events}. move has intentId,id,toIndex; success and failure have intentId. Return {ids,pending,failed}. Indices are clamped.

Acceptance criteria

  • Apply each move immediately.
  • Track the prior neighbor anchors for each intent.
  • Success removes only that intent.
  • Failure removes that move effect without discarding later intents.
  • Keep browser-visible state consistent with the canonical service result.

Constraints

  • Do not mutate caller-owned input.
  • Keep the supplied framework adapter and public contract unchanged.
  • Add candidate tests for at least one boundary not covered by the public cases.

Editable files

  • src/repair.js — Task-specific state or service boundary
  • tests/candidate.test.js — Candidate-authored regression

What this task practices

Optimistic workflow journal is a coding (platform) interview exercise that trains prompt interpretation, explicit assumptions, a concrete response, and a clear explanation of tradeoffs. The catalog marks it as hard difficulty. It focuses on State Modeling, Regression Testing, Technical Reasoning. The signed-in workspace provides the tools for the round and evaluates the attempt against task-specific criteria. Reference solutions, hidden checks, evaluator instructions, and candidate work remain private.

Sign in to startThe workspace and evaluation open after sign in.