Log inBook a Demo
BuildMidBackendAuto-graded

Make a JSON merge patch handle null correctly

Catches out anyone who codes what feels obvious instead of what the written rule actually says.The PATCH endpoints let clients update a stored JSON document by sending a merge patch describing the change, and applying it should follow RFC 7386 exactly. The current implementation is close but violates the spec in three subtle ways that bite in production — most importantly around null, which the RFC defines as a deletion rather than a value to store.
30 min
python

You're done when

  • The RFC's own reference cases produce the results the specification requires.
  • A null in the patch deletes the key rather than setting it to null.
  • Arrays are replaced wholesale rather than merged element by element.
  • Nested objects merge recursively as the spec describes.
  • The input document is not mutated — the patch returns a new value.
  • Behaviour matches a reference implementation across a broad set of generated documents and patches.

What it measures

Data structures and algorithmsRecursive merging across nested structures with different rules for objects and arrays.
Test case designUsing the specification's own cases plus a differential oracle rather than hand-picked examples.
Specification fidelityHonouring the null-as-delete rule and non-mutation, the two details implementations most often get wrong.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

30 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo