You must be able to design prompts that separate persistent instructions from task input, label multiple documents clearly, and ground answers in supplied text. The single most important thing is choosing the right field and structure so Claude references only the provided context.
Start practicing
Prompt and Context Engineering — choose a session length
Free · No account required
Domain overview
This domain covers how to structure prompts and manage context when building on the Claude API. It is tested through scenario questions about system vs. user fields, multi-document inputs, evaluation with hold-out sets, and reducing hallucination in tasks like summarization with Claude 3.
5 Sonnet.
Exam objectives
Choosing the system field for persistent role and behavior instructions versus the user field for task-specific input.
Structuring multiple independent documents in one prompt with clear delimiters or tags so Claude can reference each accurately.
Using hold-out prompt sets the model was not trained on to evaluate performance without data leakage.
Applying grounding techniques such as instructing Claude to answer only from provided source text to reduce hallucinated figures.
Putting durable role and formatting rules in the user turn instead of the system field, causing inconsistent behavior across requests.
Concatenating multiple documents without delimiters or labels, so Claude cannot reliably attribute content to the correct source.
Evaluating on prompts similar to training data instead of a true hold-out set, producing inflated and misleading performance results.
Click any question to see the full explanation and answer options, or start a focused practice session above.
You are developing a summarization tool using Claude 3.5 Sonnet. You notice the model often hallucinates specific financial figures not present in the source text. What is the most effective prompt engineering strategy to mitigate this?
2Which TWO of the following practices are considered best practices for optimizing Claude's performance using prompt engineering? (Choose two)
3When designing a system prompt for a chatbot, which approach is most effective for ensuring the model maintains a consistent tone?
4Which THREE strategies are effective for reducing 'prompt leakage' (where the model reveals its system instructions)? (Choose three)
5When evaluating LLM performance, why is it critical to use a 'hold-out' test set of prompts that the model was not trained on?
6Which method is best for improving Claude's accuracy in a complex multi-step reasoning task?
7When should you use the 'system' field versus putting instructions in the 'user' field?
8Which THREE of the following are valid methods to optimize the token usage of a prompt without sacrificing performance? (Choose three)
9A developer needs Claude to analyze a legal document and extract specific clauses into a structured format. To ensure the model focuses only on the provided text and ignores its general knowledge of law, which prompting strategy is most effective?
10When designing prompts for complex reasoning tasks, which TWO practices are recommended by Anthropic to improve the reliability of the output?
11Refer to the exhibit. What is the primary technical benefit of the developer pre-filling the assistant's message with an opening curly brace?
12A developer wants Claude to write a poem in the style of a specific 19th-century author. Where is the most appropriate place to define this persona to ensure the highest quality and consistency?
13Which THREE strategies are effective for reducing hallucinations when Claude is asked to answer questions based on a large provided context?
14A developer is using Prompt Caching for a high-traffic customer support bot. The prompt includes a large knowledge base and the current conversation history. What is the most cost-effective way to structure the cache checkpoints?
15When using Claude to process multiple independent documents in a single prompt, what is the best way to ensure Claude can refer to each document accurately in its response?
16Refer to the exhibit. If this request is sent to Claude, what will be the result of the generated output?
17A developer is using few-shot prompting to help Claude classify customer emails. How should the examples be structured to maximize the model's performance?
18A developer wants to use Claude for a creative writing assistant that generates unpredictable and varied story ideas. Which parameter should they primarily adjust to achieve this?
19A developer needs Claude to perform a complex data transformation and then explain its work. To get the best results, what order should these tasks be requested in the prompt?
20You are building a customer support bot using Claude 3.5 Sonnet. You notice the model sometimes hallucinates policies that do not exist when the user asks about obscure edge cases. Which technique most effectively grounds the model's responses to your internal documentation?
21You are integrating Claude 3.5 Sonnet into a customer support application that maintains long, multi-turn conversations. After about 40 turns, you notice Claude begins contradicting policy details it stated earlier in the same session, even though the policy text is still included in the system prompt. The conversation history is passed in full on each request. What is the most effective structural change to preserve instruction adherence across the session?
22A developer is building a pipeline that summarizes a 200-page technical manual with Claude Sonnet. The manual is too long for a single request, so the developer splits it into 40 chunks and summarizes each chunk independently. The final summaries must remain factually consistent with one another and with the source, and the developer has a fixed token budget. Which two techniques should the developer apply to keep the chunk summaries consistent and grounded? (Choose two.)
23A developer is building a customer-support agent on the Claude Messages API. The agent receives a long conversation history plus a retrieved knowledge-base article, and the developer wants Claude to answer only from the retrieved article while still seeing the full chat for tone. The developer wants the retrieved article treated as the most authoritative source, even if earlier turns contain outdated policy statements. Where should the retrieved article be placed, and how should it be marked?
24A developer is building a customer-support assistant that must answer only from a provided knowledge base article and must refuse to answer when the article does not contain the information. The assistant currently invents plausible answers. Which prompt change best enforces the refusal behavior?
25A developer is building a pipeline that uses Claude to convert free-text incident reports into a strict JSON object with fields severity, services, and summary. During testing, roughly 8 percent of outputs include a friendly preamble such as 'Sure, here is the JSON:' or wrap the object in markdown code fences, which breaks the downstream parser. The developer has already described the schema precisely in the prompt. What is the most reliable next step to eliminate the malformed outputs?
26A developer is building a customer-support bot with the Claude Messages API. The system prompt instructs Claude to answer concisely, but the bot also needs to return a stable JSON object with the fields 'intent', 'sentiment', and 'reply' on every turn. Where should the instruction to produce this JSON object be placed to most reliably control the response format?
27A developer is using the Messages API to have Claude return a JSON object describing a product. The response sometimes includes a conversational preamble such as 'Here is the JSON you requested:' before the object, which breaks the downstream parser. What is the most reliable way to eliminate the preamble?
28A developer is writing a support-triage prompt for Claude. The prompt contains a 12-page product manual followed by the customer's question. Testing shows Claude sometimes answers using general knowledge about competing products instead of the manual. The developer wants Claude to ground every answer in the manual and to say 'not covered' when the manual lacks the answer. Which change best achieves this?
29A developer is using Claude to review a 180-page contract. The model must cite the exact page number for each risk it flags. Placing the entire contract in the prompt causes the model to cite vaguely or omit page numbers. Which change best improves citation accuracy without exceeding the context window?
30A developer maintains a Claude-powered assistant that answers questions over a 60,000-token internal policy corpus. The corpus is stable and reused across every request, and the developer wants to cut cost and latency while preserving answer quality. Which two changes will most directly reduce per-request token processing for this workload? (Choose two.)
31A developer is designing a prompt that asks Claude to extract action items from meeting transcripts. The transcripts are noisy, with overlapping speakers and side conversations. Which TWO prompt-engineering practices will most improve the reliability of the extracted action items? (Choose two.)
32You are building a support-triage assistant on the Anthropic API. Each request must return a JSON object with keys 'category' and 'priority'. During testing, Claude wraps its output in markdown fences and adds a friendly sentence before the JSON. You want the raw, parseable object every time without changing the model or adding a second call. What is the most reliable prompt-level change?
33A developer is building a document-review assistant that must extract every monetary figure from contracts and cite the page where each figure appears. The contracts average 40 pages. Early tests show Claude misses figures that appear in tables and occasionally cites the wrong page. The developer wants to improve recall and citation accuracy without changing the model. Which approach is most effective?
34A developer is iterating on a classification prompt for support tickets. Each test run uses a different random sample of 200 tickets, and accuracy swings by 8 points between runs. The prompt itself is unchanged. What is the best first step to get trustworthy signal about whether a prompt edit actually helped?
35A developer needs Claude to transform a list of product descriptions into a fixed XML schema that a downstream parser expects. The model sometimes adds a friendly introductory sentence before the XML. Which change most directly eliminates the extra prose?
36A developer is tuning a customer-feedback classifier on the Anthropic API. The model currently mislabels sarcastic complaints as praise. The developer wants to improve accuracy using few-shot examples in the prompt. Which TWO practices should be applied? (Choose two.)
37A developer is drafting a system prompt for a coding assistant. They want Claude to always answer in the same tone and follow the same safety constraints regardless of what the user types. Where should these persistent rules be placed?
38A developer is using Claude to review pull requests. The prompt includes a 4,000-line diff followed by the question 'List any security issues.' Claude's answers are vague and sometimes reference the wrong file. The developer wants more precise, file-specific findings without switching models. Which change is most likely to improve precision?
You must be able to design prompts that separate persistent instructions from task input, label multiple documents clearly, and ground answers in supplied text. The single most important thing is choosing the right field and structure so Claude references only the provided context.
The Courseiva CCDV-F question bank contains 38 questions in the Prompt 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 Prompt 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