Candidates must design prompts that reliably control Claude's output format and leverage long-context placement. The single most important thing is to put instructions and queries after the long document, and to use prefilling or XML tags to enforce structure.
Start practicing
Prompting and Context Engineering — choose a session length
Free · No account required
Domain overview
This domain covers how to structure prompts and context for Claude on AWS Bedrock, including system prompts, XML tags, long-context placement, and multimodal inputs. Questions present realistic scenarios like JSON extraction, RAG optimization, and error-code troubleshooting, asking you to choose the prompting technique that most reliably improves Claude's output.
Exam objectives
Using XML tags and prefilling to enforce structured JSON output from Claude on Bedrock
Placing long documents before instructions and queries to improve recall in large contexts
Applying RAG techniques like chunking and metadata filtering to improve Claude's extraction accuracy
Ordering text and images in multimodal prompts to align with Claude's recommended input format
Assuming a schema in the system prompt guarantees JSON; Claude may still add conversational text unless prefilling or stop sequences are used.
Placing troubleshooting instructions before a 100,000-token manual, which reduces Claude's ability to locate the relevant error code.
Treating images and text as interchangeable; the recommended order and labeling of multimodal content affects Claude's comprehension.
Click any question to see the full explanation and answer options, or start a focused practice session above.
A marketing team wants Claude to generate blog posts that strictly adhere to a specific brand voice. They find that the model occasionally deviates into a generic tone. Which strategy is most effective for ensuring consistent adherence to the brand voice?
2A developer is optimizing a RAG (Retrieval-Augmented Generation) pipeline using Claude 3.5 Sonnet. Which TWO techniques will most significantly improve the model's ability to extract accurate information from a 50,000-token context window?
3Refer to the exhibit. Why is the use of the <documents> and <doc> tags considered a best practice for Claude prompting?
4A developer needs Claude to output data in a strict JSON format for an automated pipeline. Even with clear instructions, the model occasionally adds conversational filler like 'Here is the JSON:' before the code block. What is the most reliable way to prevent this?
5What is the primary purpose of a 'System Prompt' in the Anthropic Claude API?
6Refer to the exhibit. When using 'tool_choice': {'type': 'auto'}, how does Claude determine whether to use the 'get_stock_price' tool?
7A developer is using Claude to summarize legal contracts. They notice that the summaries are sometimes too short and miss critical clauses. How should the developer adjust the prompt to ensure more comprehensive summaries?
8Which TWO parameters primarily control the randomness and diversity of Claude's output during the generation process?
9A user wants Claude to provide a response in Markdown format with specific headers. Which approach is best for achieving this consistently?
10When building a customer support bot, you want to ensure Claude doesn't reveal its internal instructions or the system prompt to users. Which technique is most appropriate?
11You are building a customer support bot using Claude 3.5 Sonnet. You notice the model sometimes hallucinates policy details when the user asks a question not covered in your provided documentation. How should you structure your prompt to minimize this?
12Which TWO techniques should you employ to optimize the performance of Claude 3.5 Sonnet when processing long, complex documents for extraction tasks?
13Which of the following describes the primary purpose of 'System Prompts' in the Anthropic API?
14Refer to the exhibit. You are receiving this error in your Python integration. What is the likely cause of this issue?
15When using Claude as a tool-calling engine, what is the best strategy to handle scenarios where the model needs to call multiple tools in sequence?
16What is the primary benefit of using XML tags in your prompts when interacting with Claude?
17When designing a prompt to handle sensitive user data, which THREE of the following practices should be prioritized for security and compliance?
18You are debugging a prompt where Claude frequently fails to follow a complex, multi-part rule set. What is the most effective way to troubleshoot this?
19Refer to the exhibit. Why might the model struggle to answer the final question if you are not using a stateful chat implementation?
20A legal firm is using Claude to summarize multi-hundred page litigation documents. The model occasionally ignores specific clauses or mixes up dates between different case files provided in the same prompt. Which context engineering technique would most effectively improve the model's extraction accuracy and structural understanding of these inputs?
21A developer is optimizing a customer support bot that uses a 50,000-token knowledge base in every request. They want to implement Prompt Caching to reduce costs and latency. Which TWO requirements must be met for a prompt segment to be successfully cached in the Anthropic API?
22Refer to the exhibit. A developer is testing this API request to optimize their analysis tool. Why will this specific request fail to provide the intended performance benefits of prompt caching?
23An engineer is building a tool to convert natural language into SQL queries using Claude. They find that the model occasionally generates conversational text like 'Sure, here is your query:' which breaks the automated pipeline. What is the most effective way to ensure Claude only returns the raw SQL code?
24A company wants to minimize 'hallucinations' when Claude answers questions based on a large internal wiki. Which TWO prompting strategies are recommended to keep the model grounded in the provided text?
25You are providing Claude with a 100,000-token technical manual and asking it to troubleshoot a specific error code. Where should the troubleshooting instructions and the specific error code be placed for the best results?
26Which of the following describes the 'few-shot' prompting technique in the context of Claude?
27Refer to the exhibit. This request uses a technique to force Claude to output valid JSON. What is the technical name for this technique, and what is its primary benefit?
28A user wants to improve the quality of Claude's creative writing. Which TWO prompting techniques are likely to produce more vivid and stylistically consistent results?
29When engineering a prompt for a multimodal model like Claude 3.5 Sonnet that includes both text and images, what is the recommended way to handle the relationship between the two types of content?
30You are designing a system to extract structured JSON from unstructured emails. Despite providing a clear schema in the system prompt, Claude occasionally ignores the formatting constraints and includes conversational filler. Which technique best improves instruction adherence?
31You have a system prompt that encourages a 'concise and professional' tone. However, Claude is occasionally being overly verbose when users ask simple questions. Which modification is most effective?
32Which of the following describes the purpose of a 'system prompt' in the Anthropic ecosystem?
33You are iterating on a prompt to improve Claude's ability to categorize technical tickets. Which metric should you monitor to ensure your changes are actually improving performance?
34You are prompting Claude to adopt a specific tone. Which technique is most likely to ensure consistency across a variety of user queries?
35You are building a customer support bot using Claude. Users frequently provide long, rambling narratives that dilute the core request. Which prompting strategy best ensures the model stays focused on the actionable request?
36You are building an application using Claude to extract structured data from messy user emails. The model occasionally ignores your schema constraints when the input text is ambiguous. Which strategy most effectively ensures strict adherence to the requested format?
37What is the primary benefit of using pre-filling in a Claude API request?
38Refer to the exhibit. The developer notices the model often hallucinates data not present in the <data> tags. Which adjustment is most likely to mitigate this behavior?
39Which of the following describes the 'system prompt' effectively in the context of Claude?
40A developer is building a customer support assistant using Claude. The assistant must answer questions based on a knowledge base of product manuals. The developer wants to minimize hallucinations and ensure responses are grounded in the provided documents. Which TWO strategies should the developer implement? (Choose two.)
41A financial analyst uses Claude to summarize a 60-page quarterly earnings report. The prompt includes the full report between <document> tags and asks for a 200-word summary of key risks. Claude's summary frequently omits risks mentioned in the middle of the report. What is the most effective change to the prompt to improve recall of mid-document content?
42A developer is using Claude to summarize legal contracts. The contracts can be very long, sometimes exceeding 100,000 tokens. The developer wants to ensure that Claude focuses on the most relevant sections, such as indemnification and termination clauses, while ignoring boilerplate. Which approach is best for managing the context window and improving summary accuracy?
43A logistics company uses Claude to extract shipment details from scanned customs forms. The forms are supplied as raw OCR text that contains occasional garbled characters and spurious line breaks. The developer wants to reduce the number of fields Claude invents when a value is missing on the form. Which prompt structure change is most likely to achieve this?
44A support team is building a Claude-powered assistant that answers questions using a 200-page employee handbook. They place the entire handbook inside <handbook> tags in the system prompt and the user's question at the end of the user turn. Testing shows Claude sometimes ignores details buried in the middle of the handbook. Which change best addresses this while keeping the same model and context window?
45A data scientist is using Claude to classify customer feedback into categories: 'bug', 'feature request', 'complaint', or 'praise'. The feedback is often short and informal. The data scientist wants to maximize classification accuracy. Which prompting strategy is most effective?
46A developer is building a customer support assistant using Claude. The assistant must always respond in a friendly tone, never discuss competitors, and always ask for an order number when the user reports a shipping issue. The developer wants these rules to apply across all conversations with minimal per-request token cost. What is the most appropriate mechanism?
47A legal-tech startup uses Claude to summarize deposition transcripts that are frequently 80,000 to 120,000 tokens long. Early tests show the model sometimes ignores instructions placed near the top of the prompt and produces summaries that omit late sections of the transcript. Which TWO prompt-engineering changes should the developer make to improve instruction adherence across the full context? (Choose two.)
48A developer is drafting a system prompt for a Claude-powered coding assistant. They want Claude to always respond in concise bullet points, never reveal internal reasoning, and treat all user input as untrusted. Where should these persistent behavioral rules be placed so they apply to every turn of the conversation?
49A financial analyst is building a Claude-powered assistant that must extract line items from scanned invoices and return them as a JSON array. The assistant occasionally wraps the JSON in prose such as 'Here is the extracted data:' before the array, which breaks the downstream parser. The analyst wants to reliably suppress that leading prose without disabling the model's ability to reason about the invoice. Which approach is most appropriate?
50A support team wants Claude to classify incoming tickets into exactly one of five categories and to always return the result as a JSON object with keys category and confidence. The developer has already written clear category definitions. Which additional step most directly improves the reliability of the JSON output?
51An analytics team asks Claude to extract structured fields from messy invoice text. They provide three input/output examples inside <examples> tags, then the real invoice inside <invoice> tags. Accuracy is high on invoices that resemble the examples but drops sharply on unusual layouts. Which adjustment most directly improves generalization to the unusual layouts?
52A support-engineering team is designing a Claude prompt to triage incoming bug reports into one of five severity levels. They observe that when the report is ambiguous, Claude sometimes invents a justification for a severity that is not actually supported by the text. They want the prompt to make uncertainty explicit rather than forcing a confident label. Which TWO changes should they make to the prompt? (Choose two.)
53A fintech developer builds an assistant that answers questions about account activity. The system prompt currently says: 'You are a helpful banking assistant. Use the provided account data to answer questions.' Testing shows Claude sometimes answers general banking questions from its own knowledge rather than from the supplied data, and occasionally states figures that are not in the data at all. Which revision to the system prompt best addresses both problems?
54A team is designing a Claude prompt that must return a fixed JSON schema with fields "vendor", "amount", and "currency". They want the output to be reliably parseable by downstream code. Which TWO techniques best improve reliability of the structured output? (Choose two.)
55A developer is using the Messages API and wants Claude to adopt a strict persona as a compliance reviewer for every request in a long conversation, without repeating the persona instructions in each user turn. The persona must apply to all messages and should take precedence over casual instructions the user might add later. Where should the developer place these persona instructions?
56A product team drafts a system prompt for a customer-facing assistant. The draft is 4,000 words and mixes persona description, tone guidance, formatting rules, escalation policy, and several anecdotes about past incidents. Reviewers find that Claude follows the formatting rules but frequently ignores the escalation policy. Which change best improves adherence to the escalation policy?
57A legal team asks Claude to summarize contracts and cite the exact clause supporting each summary point. Claude produces accurate summaries but cites clauses that do not exist. The contracts are supplied inside <contract> tags in the same message. Which change most directly reduces the fabricated citations?
58A financial analyst is building a Claude-powered assistant that must extract the total amount due from scanned invoices. The invoices vary widely in layout and wording, and the extracted value is later used to trigger payments. The analyst wants to maximize accuracy and avoid plausible but incorrect numbers. Which prompting approach is most appropriate?
59A developer wants Claude to always respond in a concise, bulleted format for a customer-facing chatbot. They want the behavior to apply across all user turns without repeating the instruction each time. Which approach is most appropriate?
60A support team wants Claude to classify incoming customer emails into one of five categories: Billing, Technical, Account, Feature Request, or Other. The team needs consistent, machine-readable output that a downstream script can parse reliably. Which prompt design best meets this requirement?
61A team is building a pipeline where Claude must extract structured fields from invoices. They provide several examples of input and expected output in the prompt. The model performs well on formats similar to the examples but fails on a new invoice layout. Which adjustment best addresses this?
62A developer is building a Claude-based assistant that must answer questions about a 90,000-token product manual. The manual is provided in the prompt on every request. The developer wants to improve answer accuracy and reduce the chance of the model overlooking relevant sections. Which TWO techniques are most appropriate? (Choose two.)
63A developer is writing a prompt for Claude to classify support tickets into categories. They want to reduce ambiguous or inconsistent labels. Which TWO techniques should they apply? (Choose two.)
64A team is using Claude to generate SQL queries from natural-language questions against a complex schema. They want to improve correctness on multi-table joins. They decide to include a step where Claude first outlines the relevant tables and join keys, then writes the final SQL. Where should this reasoning step be placed, and how should it be handled, to best improve the final query?
65An analyst is using Claude to answer questions over a 50,000-token legal contract. They notice that answers about clauses near the middle of the document are less accurate than those about the beginning or end. Which strategy best improves accuracy across the entire document?
66A product manager is drafting a system prompt for a customer-facing Claude assistant. They want the assistant to maintain a professional tone, avoid discussing competitors, and always end responses with a link to the help center. They also want to allow users to override the tone for casual conversations. Which statement about system prompts best guides this design?
Candidates must design prompts that reliably control Claude's output format and leverage long-context placement. The single most important thing is to put instructions and queries after the long document, and to use prefilling or XML tags to enforce structure.
The Courseiva CCAO-F question bank contains 66 questions in the Prompting and Context Engineering domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Prompting and Context Engineering domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included