Claude Certified Architect – Foundations Practice Question 16: Few Shot Examples

Claude Certified Architect, Foundations · Test 2 · question 6 of 10

Prompt Engineering & Structured Outputeasy

A developer asks Claude to classify customer emails into refund, shipping, bug or other. Accuracy is poor on borderline emails, and in testing Claude sometimes copies the wording of the single example in the prompt, which is a plain refund request. The developer wants to improve consistency using few-shot prompting. What is the best approach?

Select one answer
Show answer and explanation

Answer:

  • C. Provide several relevant, diverse examples that include edge cases, wrapped in <example> tags inside the prompt

C is correct. Anthropic's guidance for multishot prompting is that examples should be relevant (mirror the real use case), diverse (cover edge cases and vary enough that Claude does not pick up unintended patterns), and structured (wrapped in <example> tags, or <examples> for a set, so they are distinguishable from instructions). A handful of well-chosen examples typically improves accuracy and consistency.

A is wrong because repeating one example makes the copying problem worse. B is wrong because examples are one of the most reliable ways to steer output; the problem is their narrowness, not examples themselves. D is wrong because near-identical examples teach a narrow pattern and leave borderline cases uncovered.

Reference: Prompting best practices - Use examples effectively

Practice Test 2 ›

Study guides for Claude Certified Architect, Foundations