Courseiva

CCDV-F · domain

Prompt and Context Engineering

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.

38 questions7 easy22 medium9 hard

Focused practice

Practice Prompt and Context Engineering questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Prompt and Context Engineering

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.

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.

Watch out for

Common Prompt and Context Engineering exam traps

  • ▸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.

Question index

All Prompt and Context Engineering questions (38)

Click any question to see the full explanation, or start a practice session above.

1

You 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?

Medium
2

A 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?

Hard
3

A 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?

Easy
4

A 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?

Hard
5

Refer to the exhibit. If this request is sent to Claude, what will be the result of the generated output?

Medium
6

You 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?

Medium
7

A 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?

Medium
8

Which THREE strategies are effective for reducing 'prompt leakage' (where the model reveals its system instructions)? (Choose three)

Hard
9

A 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?

Hard
10

A 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?

Hard
11

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?

Medium
12

Which TWO of the following practices are considered best practices for optimizing Claude's performance using prompt engineering? (Choose two)

Medium
13

A 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?

Hard
14

A 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?

Medium
15

A 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?

Medium
16

A 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?

Medium
17

A 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.)

Hard
18

You 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?

Medium
19

When designing prompts for complex reasoning tasks, which TWO practices are recommended by Anthropic to improve the reliability of the output?

Medium
20

Which THREE of the following are valid methods to optimize the token usage of a prompt without sacrificing performance? (Choose three)

Medium
21

A 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?

Easy
22

A developer is using few-shot prompting to help Claude classify customer emails. How should the examples be structured to maximize the model's performance?

Medium
23

A 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.)

Medium
24

A 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.)

Medium
25

A 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?

Easy
26

A 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?

Hard
27

When should you use the 'system' field versus putting instructions in the 'user' field?

Medium
28

A 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?

Easy
29

A 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?

Medium
30

A 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?

Easy
31

Refer to the exhibit. What is the primary technical benefit of the developer pre-filling the assistant's message with an opening curly brace?

Hard
32

A 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.)

Medium
33

Which THREE strategies are effective for reducing hallucinations when Claude is asked to answer questions based on a large provided context?

Medium
34

Which method is best for improving Claude's accuracy in a complex multi-step reasoning task?

Medium
35

When evaluating LLM performance, why is it critical to use a 'hold-out' test set of prompts that the model was not trained on?

Medium
36

When 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?

Medium
37

When designing a system prompt for a chatbot, which approach is most effective for ensuring the model maintains a consistent tone?

Easy
38

A 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?

Easy

Frequently asked questions

What does the Prompt and Context Engineering domain cover on the CCDV-F exam?
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.
How many questions are in this domain?
This page lists all 38 Prompt and Context Engineering questions in the CCDV-F question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Prompt and Context Engineering questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
anthropic-claude-developer ANTHROPIC-CLAUDE-DEVELOPER prompt and context engineering Practice Questions