RefactorSeniorBackendAuto-graded
Serve v1 and v2 clients from one API
Interfaces that other teams depend on have to change without stranding the customers still using the old version.The users service was refactored to a cleaner v2 shape last week. The refactor itself was good — but it changed the existing fields and a status code instead of adding the new version alongside the old one, and every v1 client broke the moment it deployed. Restore the v1 contract exactly while keeping v2 available, so both generations of client are served from one codebase.35 min
python
You're done when
- The service boots and serves requests.
- v1 clients receive exactly the fields and status codes they depended on before the refactor.
- v2 fields do not leak into v1 responses.
- v1 fields do not leak into v2 responses.
- Both versions are served from the same service rather than one replacing the other.
What it measures
API designVersioning a contract so an improvement can ship without breaking existing consumers.
Code refactoringSeparating two response shapes cleanly instead of branching on a version flag throughout the handler.
Backward compatibilityTreating the old contract as a promise to be honoured exactly, down to the status code.
Your environment
Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards
Start this lab
35 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