# Iterative refinement: examples, tests and interviews

*Claude Certified Architect - Foundations Study Guide · Claude Code Configuration & Workflows · Last updated October 22, 2026 · https://www.certifyforce.com/study-guide/claude-certified-architect-foundations/claude-code-configuration-and-workflows/iterative-refinement-examples-tests-and-interviews*

How to steer Claude Code toward the right result over several rounds: concrete input/output examples when prose is misread, test-first iteration without editing or hard-coding to the tests, the interview-then-spec-then-fresh-session pattern, batching interacting issues versus fixing independent ones in turn, and resetting with /clear after repeated failed corrections.

- Certification: Claude Certified Architect - Foundations
- Exam section: Claude Code Configuration & Workflows
- Study guide: https://www.certifyforce.com/study-guide/claude-certified-architect-foundations

**Official exam objective:**

> Apply iterative refinement techniques for progressive improvement

## What the exam expects

- Replace an ambiguous prose rule with 2-3 concrete input/output examples when Claude keeps reading it differently, and give a specific test case (sample input, exact expected output) to fix an edge case such as null values.
- Run test-driven iteration: tests for expected behaviour, edge cases and performance first, confirm they fail, then let Claude iterate on the failures without editing the tests or hard-coding to them.
- Use the interview pattern in an unfamiliar domain, then have Claude write a spec and implement it in a fresh session.
- Put interacting issues in one detailed message, and fix independent issues one at a time.
- Recognise when to stop correcting and start a clean session with `/clear` and a better prompt.

Key terms: **input/output example** (a concrete before-and-after pair that shows the transformation); **test-driven iteration** (tests written before the code act as the fixed target Claude iterates against); **interview pattern** (Claude asks you questions, via the `AskUserQuestion` tool, before building); **verification criteria** (a check Claude can run that returns pass or fail); **course correction** (redirecting or resetting a session that has gone off track).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Examples vs prose | Examples of the desired output beat abstract instructions | [Increase output consistency](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/increase-consistency) |
| Example count | Exam guide: 2-3 I/O pairs; prompting page: 3-5 few-shot examples | [Exam guide](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf), [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) |
| Bug-fix pattern | Write a failing test that reproduces the issue, then fix it | [Best practices](https://code.claude.com/docs/en/best-practices) |
| Editing tests | "Unacceptable to remove or edit tests" | [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) |
| Hard-coding | Ask for logic that works for all valid inputs, not just the test cases | [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) |
| Interview tool | `AskUserQuestion`; finish with a complete spec in `SPEC.md` | [Best practices](https://code.claude.com/docs/en/best-practices) |
| After the interview | Implement the spec in a fresh session | [Best practices](https://code.claude.com/docs/en/best-practices) |
| Correction limit | More than two corrections on one issue → `/clear` and a better prompt | [Best practices](https://code.claude.com/docs/en/best-practices) |
| Interacting vs independent issues | One detailed message vs sequential iteration | [Exam guide](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf) |

## Check yourself

- When do concrete input/output examples beat a better prose description?
- Why should the implementation run in a fresh session after an interview?
- What should a prompt say to stop Claude special-casing test inputs?
- When should you stop correcting Claude and run `/clear`?

## Sources

- [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices)
- [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices)
- [Increase output consistency](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/increase-consistency)
- [Common workflows](https://code.claude.com/docs/en/common-workflows)
- [Claude Certified Architect – Foundations Exam Guide v1.0](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 10 linked practice questions, and unlimited timed mock exams are included with the Claude Certified Architect - Foundations pack (USD $19): https://www.certifyforce.com/practice-exams
