Refactor code you have never seen, with a model
Hard45 minFree, no account
An 800-line file, no tests, and a model that will happily rewrite all of it.
The question
You are handed a single 800-line module that computes shipping costs. It has no tests, three nested conditionals eight levels deep, and a comment that says "do not touch. See INC-4471".
A product change requires a new rule. Use a model to make the change safely.
45:00Commit to an answer before you open the solution. Reading it first teaches you to recognise good answers, which is not the skill being tested.
Stuck?
0 of 3 hints takenThe worked solution
written by a person · not a gradeScore yourself
0 of 5 marked- Built a characterisation harness before changing anything30
- Distinguished freezing behaviour from asserting correctness20
- Small verified steps rather than a wholesale rewrite25
- Split what to delegate from what to keep, with reasons15
- Respected the incident-marked code10
We run no AI here and nothing on this page grades you. The score is yours, and the useful number is the one you get on the same problem a month from now, cold.
kept in this browser only