A developer on your engineering team is designing a prompt template that includes few-shot examples alongside reference documents and user queries. They place the examples after the user query and use markdown bullet points instead of XML tags. Based on Anthropic prompt engineering best practices, why is this design suboptimal?
Placing few-shot examples and reference context before the user query establishes the required pattern and background knowledge before the model processes the active task. Using descriptive XML tags for each section ensures Claude accurately distinguishes between instructional examples and the final user input.
Why this answer
Anthropic recommends placing reference materials and few-shot examples near the top of the prompt, followed by the user query at the end, all clearly organized with descriptive XML tags. Placing examples after the query or using weak markdown bullets reduces the structural clarity that helps Claude anchor its formatting and task execution pattern accurately.
Exam trap
Candidates often overlook the ordering of prompt components, placing few-shot examples randomly or at the very end after the user input, which disrupts the model's contextual grounding.