Apply iterative refinement techniques for progressive improvement
What you should be able to do
- Replace an inconsistently-interpreted prose description with two or three concrete input/output examples.
- Iterate test-first: write the suite, then feed failures back as the guide to improvement.
- Use the interview pattern to surface considerations before implementing in an unfamiliar domain.
- Decide whether issues go in one message or in sequence, from whether the fixes interact.
Exam traps (5)
Describe the transformation more precisely in prose when the output is inconsistent.
Prose is what was already ambiguous; more of it adds clauses to reconcile and often makes the spread wider.
Two or three concrete input/output pairs settle the shape faster than any amount of description.
Implement first, then write tests to confirm it works.
Tests written afterwards encode what the code does, so they pass by construction and the edge cases nobody considered stay unconsidered.
Write the suite first — expected behaviour, edge cases, performance — and iterate on its failures.
Report every issue you found in one message so nothing is forgotten.
Independent problems batched together produce a large diff where fixes interfere and attribution is lost when something regresses.
Batch issues whose fixes interact; sequence the ones that do not.
Specify the requirements fully up front in a domain you do not know well.
You cannot specify the considerations you have not met — invalidation, failure modes, ordering — and they surface as rework.
Ask for the questions first. The interview pattern surfaces what the specification was missing.
Say the edge case is mishandled and ask for it to be fixed.
"Handle nulls properly" is the same ambiguity that produced the bug, so the fix targets a different reading of it.
Give the failing input and the expected output.
Primary sources
- Claude Code — common workflowschecked 2026-08-15
- Prompt engineering — multishot promptingchecked 2026-08-15
Know cold
- Interview pattern
- Few-shot prompting
- Validator
- Explicit criteria / rubric
5 practice questions in the bank are tagged to this task statement.
Practise this task in context: open it inside the interactive study guide, which carries the concept cards, the mock quiz and the practice simulation.