Claude Certified Architect – Foundations Practice Question 17: Long Document Placement

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

Prompt Engineering & Structured Outputmedium

A legal-tech application sends Claude three contracts of roughly 30,000 tokens each, along with the question "Which clauses conflict on termination notice periods?" The current prompt puts the instruction and the question first, then the contracts. Answers are inconsistent. Which restructuring follows Anthropic's guidance for long-context prompts?

Select one answer
Show answer and explanation

Answer:

  • D. Place the documents at the top, each in its own tagged block, and put the question and instructions after them at the end

D is correct. Anthropic recommends putting longform data near the top of the prompt, above the query, instructions and examples, which improves performance across models. Wrapping each document in tags (for example <document> with <source> and <document_content>) helps Claude tell them apart, and placing the query at the end works especially well for multi-document inputs.

A is wrong because it keeps the instructions ahead of the data and duplicating contracts wastes tokens without helping. B is wrong because moving documents into the system prompt is not the recommended structure, and an empty user turn does not make the query clearer. C is wrong because Claude handles long inputs well when structured properly, and one-sentence summaries would discard the clause detail needed to compare notice periods.

Reference: Prompting best practices - Long context prompting

Practice Test 2 ›

Study guides for Claude Certified Architect, Foundations