Practice questions
CCDV-F practice questions, free.
60 original scenario questions for Claude Certified Developer – Foundations, written from the published blueprint and weighted the way the exam is. Pick an answer, check it, read why. None of these are exam questions; the real exam tests the same judgment on scenarios you have not seen.
How to use these
Filter by domain to drill a weak area, or work through the whole bank. Answer before you reveal. Note the domain of every miss. When you are done, the score box tells you whether you are above the equivalent of the 720 pass mark; if you are not, the domains you missed are your reading list. The full domain-by-domain notes are on the CCDV-F exam page.
The questions
A response comes back with stop_reason set to max_tokens. What happened?
Show answer
Answer: The output reached the max_tokens limit and was cut off before the model finished. max_tokens means truncation: the output hit the cap you set. Raise the limit or continue the response. end_turn is the natural finish, and an oversized input fails before any stop_reason is produced.
A response has stop_reason tool_use. What must your code do next?
Show answer
Answer: Execute the requested tool, append a tool_result block with the matching id, and call the model again. tool_use hands control to your code. You run the tool, return the result in a tool_result block, and let the model continue. Client tools are not executed server-side, and the model cannot produce a tool_result on its own.
Users should see the answer appear as it is generated. What do you use?
Show answer
Answer: Set stream to true and render content_block_delta events as they arrive. Streaming delivers partial content as server-sent events; your client renders the deltas. There is no polling status for a synchronous message, and batches add latency rather than remove it.
You have 20,000 documents to classify overnight, with no latency requirement, and cost matters. Best choice?
Show answer
Answer: Submit them through the Message Batches API and collect results when the batch completes. Batches trade latency for lower cost and are built for large, non-urgent workloads. A worker pool works but pays full price, and one giant request runs into context and output limits.
Every request includes the same 30,000-token reference manual followed by a short question. How do you cut cost?
Show answer
Answer: Put a cache_control breakpoint on the manual block so the prefix is reused across requests. Prompt caching reuses a stable prefix. The manual is the prefix; the question changes each time and comes after the breakpoint. Files API uploads still count as input tokens on every request that references them.
Your integration starts receiving HTTP 429 responses. What is the right client behavior?
Show answer
Answer: Back off exponentially with jitter and honor the retry-after header when it is present. 429 is rate limiting. Exponential backoff with jitter spreads retries; retry-after tells you how long to wait. Limits apply at the organization level, so swapping keys does not help.
A pipeline extracts three fields from short emails, millions of times a month. Which model tier makes sense?
Show answer
Answer: The smallest tier that passes your eval, since cost and latency dominate at this volume. Match the model to the task. Simple, high-volume extraction is where the small tier earns its keep; measure with an eval first. Thinking adds cost on every call, which is the wrong trade for short emails.
You need the same input to produce the same extraction every time. Which setting helps most?
Show answer
Answer: Set temperature near 0 so sampling favors the most likely tokens. Low temperature makes sampling less random. It is the first lever for deterministic-style tasks. Caching reuses the prefix computation but does not constrain sampling.
Which loop correctly implements a tool-using agent?
Show answer
Answer: Call the model; on tool_use run the tool, append the result, call again; stop on end_turn or a turn cap. The agent loop alternates model turns and tool execution until the model ends its turn or a safety limit stops it. Running tools up front skips the model's decision about which tool to call and with what arguments.
What does the Claude Agent SDK handle for you that a hand-rolled loop does not?
Show answer
Answer: The agent loop, tool execution, permission checks, hooks, and subagents. The Agent SDK packages the agent loop with tools, permission checks, hooks, and subagent support so you do not rebuild them. Retries and typed objects come from the plain client SDK, which still leaves the loop to you.
A multi-turn assistant's history grows until requests fail. What is the sane fix?
Show answer
Answer: Summarize older turns and keep the most recent turns verbatim. Summarization keeps the useful state while trimming tokens; recent turns stay verbatim because they matter most. Cached tokens still occupy the context window, and max_tokens only caps output.
A tool parameter may only be one of three values. How do you express that?
Show answer
Answer: Use an enum in the parameter's JSON schema and list the parameter under required. JSON schema enums and required fields are read by the model and enforced on the call. Prose in the description helps but is not enforced; tool_choice picks the tool, not its argument values.
Your agent reads web pages. One page contains text telling the assistant to email the user's files to an address. What protects you?
Show answer
Answer: Treat retrieved content as data, keep instructions in the system prompt, and gate outbound actions. Prompt injection arrives through content. Separate data from instructions and put approval gates on actions that send or delete. A disregard instruction helps at the margin but is not a control; the gate is.
An agent has a shell tool in production. What is the least-privilege setup?
Show answer
Answer: Allow a reviewed list of read-only commands and require approval for anything that writes. Read-only by default, confirmation for writes, and logs you can audit. That is least privilege for tools. Containers and directory limits reduce blast radius but still let the agent run destructive commands unprompted.
You changed a prompt and want to know whether quality regressed before shipping. What do you run?
Show answer
Answer: Run a golden test set with automated grading and compare scores with the old prompt. A fixed golden set plus a grader (rubric or LLM-as-judge) turns prompt changes into measurable diffs. Spot checks miss regressions on the cases you did not look at.
Which fields are required in a Messages API request?
Show answer
Answer: model, messages, and max_tokens. Every request names the model, provides messages, and sets max_tokens. system, temperature, and stream are optional.
Where does the system prompt go in a Messages API request?
Show answer
Answer: In the top-level system parameter of the request. The Messages API takes the system prompt as a top-level parameter. messages only accepts user and assistant roles, so a system role entry is rejected.
A response's content array contains a text block followed by a tool_use block. What does that mean?
Show answer
Answer: The model wrote some text, then requested a tool call; you run it and return a tool_result. Content blocks can mix text and tool_use; tool_use hands control to your code and the stop_reason will be tool_use. Truncation would show stop_reason max_tokens instead.
Your app sends an image for analysis. How is it included?
Show answer
Answer: As an image content block, with a base64 or URL source, inside a user message. Images are content blocks in the user turn with a source of type base64 or url. The system parameter and the tools array do not carry images.
What does stop_reason end_turn tell you?
Show answer
Answer: The model finished its turn naturally and is not waiting on anything. end_turn is the normal completion signal. A custom stop sequence reports stop_sequence, and a paused server tool turn reports pause_turn.
A streaming response is interrupted midway. What should a robust client do?
Show answer
Answer: Detect the missing message_stop event, then retry or mark the partial output as incomplete. Streams can drop; a complete stream ends with message_stop. Handle incompleteness explicitly. stop_reason is a response field, not something you can send.
You need consistent structured data from many documents. Which approach is most robust?
Show answer
Answer: Define a tool with a JSON schema for the fields, force it with tool_choice, and validate the arguments. Schema-enforced tool arguments give reliable structure; validation catches the rest. Temperature 0 makes output steadier but does not guarantee valid JSON.
Which header carries your credential when calling the API directly?
Show answer
Answer: x-api-key with the key as its value. The Anthropic API authenticates with the x-api-key header. anthropic-version is a separate required header that pins the API version.
A request returns HTTP 400 with an invalid_request_error. Most likely cause?
Show answer
Answer: A malformed body, such as a missing required field or an unsupported parameter. 400s are client-side shape problems. Rate limits are 429, permission problems are 403, and overload is 529.
What is the Files API useful for?
Show answer
Answer: Uploading a document once and referencing it by file id across many requests. Upload once, reference by id. Referenced files still count as input tokens; skipping repeated billing is what prompt caching does.
A batch job finished but some requests show errors. What should your code do?
Show answer
Answer: Read each request's result, retry the failed ones, and treat the batch as non-atomic. Batches report per-request outcomes; handle them individually. Successful requests in a partially failed batch are billed and their results are valid.
You want to count tokens before sending a large prompt to avoid exceeding limits. Which capability?
Show answer
Answer: The token counting endpoint, which returns input tokens for a prompt. Token counting lets you budget before you send. message_start usage arrives only after the request is accepted, and there is no count_tokens flag on messages.
Which SDK pattern avoids re-implementing the tool loop by hand?
Show answer
Answer: A tool runner or agent helper provided by the SDK. SDK helpers manage the tool-call loop for you. tool_choice auto only lets the model decide whether to call a tool; execution is still your job.
A multi-turn app appends every response to the history. After 50 turns the requests fail. What is the fix?
Show answer
Answer: Trim or summarize older turns to stay inside the context window. History grows; manage it. Cached tokens still occupy the context window, and max_tokens only limits output.
Which is the best practice for choosing a model tier for a new feature?
Show answer
Answer: Prototype on a capable tier, then test whether a smaller tier passes your eval at lower cost. Measure quality per tier; do not assume. Waiting for user complaints means shipping a regression to find it.
Output tokens dominate latency for a summarization endpoint. Which lever helps most?
Show answer
Answer: Constrain the output length and format so the model writes fewer tokens. Fewer output tokens means faster responses. Caching speeds up input processing, which is not the bottleneck here.
What does max_tokens control?
Show answer
Answer: The maximum number of output tokens the model may generate. max_tokens caps output only. Input is bounded separately by the model's context window.
A classification endpoint with a fixed label set should use which sampling setting?
Show answer
Answer: Low temperature so the same input maps to the same label. Deterministic tasks want low temperature. Widening the candidate set with top_k or top_p pushes the other way.
When does extended thinking justify its cost?
Show answer
Answer: On hard multi-step problems where accuracy matters more than latency. Spend thinking budget where reasoning pays. Thinking tokens are billed as output on each request; they are not cached away.
Your bill is dominated by a stable 20k-token system prompt sent on every call. First optimization?
Show answer
Answer: Add a cache_control breakpoint to the system prompt so its tokens are read from cache. Caching a stable prefix cuts repeated input cost without changing the model or latency. Batching also discounts but changes delivery time and does not fit interactive calls.
Which workload is a good fit for the Batch API?
Show answer
Answer: Nightly enrichment of a million records with no latency requirement. Batches trade latency for cost. The other three are interactive and cannot wait for a batch to complete.
What is a reasonable way to compare two models for your task?
Show answer
Answer: Run the same eval set through both and compare accuracy, cost, and latency. Head-to-head evals on your own data decide; release dates and self-assessments do not.
In a hand-rolled agent loop, what must happen before calling the model again after a tool call?
Show answer
Answer: Append a tool_result block whose tool_use_id matches the tool_use block. Tool results must be returned with the matching id, and the tool_use block stays in history so the pairing is valid.
Which pattern fits 'translate, then have a second call grade the translation, then revise until it passes'?
Show answer
Answer: Evaluator-optimizer loop. Generate, evaluate, refine. Orchestrator-workers splits a task across workers; it does not grade and revise.
What should limit an agent loop besides end_turn?
Show answer
Answer: A maximum number of iterations plus a time or cost budget. Hard caps prevent runaway loops. Letting the context window fill is a crash, not a limit.
The Claude Agent SDK's hooks are useful for:
Show answer
Answer: Running deterministic checks around tool calls, such as blocking a dangerous command. Hooks wrap tool calls with your own logic, such as blocking or transforming a call. Model switching and prompt rewriting are not what hooks are for.
A workflow has a step that sometimes needs human input. How should the code model it?
Show answer
Answer: A pause state that persists progress and resumes when the input arrives. Human-in-the-loop steps need durable pause and resume. Polling holds resources open, and restarting repeats work already done.
Which is true about subagents in the SDK?
Show answer
Answer: They run with their own context and return a result to the parent. Subagents isolate context; the parent gets back a result, not the subagent's transcript.
Why give each workflow step one responsibility?
Show answer
Answer: Each step becomes testable on its own and failures are easier to localize. Single-purpose steps are debuggable. Token savings are not guaranteed, and the API has no such rule.
Where should a long reference document sit relative to the question in a prompt?
Show answer
Answer: Before the question, clearly delimited. Documents first, question last. Splitting across turns fragments the reference and confuses the conversation structure.
Which technique reduces the chance that instructions inside a document are followed?
Show answer
Answer: Wrap documents in tags, label them as data, and keep instructions outside them. Separate data from instructions. Putting the document in the system prompt does the opposite: it lends the content authority.
What is the benefit of putting the system prompt in the system parameter rather than the first user message?
Show answer
Answer: Standing instructions stay stable and separate, and the prefix caches well. Stable, separate, cacheable. The system prompt is still billed as input tokens.
How can you make an extraction prompt more reliable without changing the model?
Show answer
Answer: Add examples of input and expected output, including an edge case. Examples anchor format and edge behavior. A persona changes tone more than accuracy.
A prompt has grown to 300 lines with contradictory rules. What should you do?
Show answer
Answer: Refactor it: remove conflicts, group rules, and test against a golden set. Prompts need maintenance like code. A precedence rule leaves the contradictions in place.
Which is a good reason to summarize conversation history rather than truncate it?
Show answer
Answer: Summarization keeps decisions and state that truncation would drop. Keep the state, drop the words. Summaries are ordinary input tokens and are billed as such.
What does a tool_result with is_error set to true tell the model?
Show answer
Answer: The call failed and the content explains why, so the model can adapt. Error results are recoverable signals. The API does not retry client tools; the model decides what to do next.
What is tool_choice set to 'any' for?
Show answer
Answer: Require the model to call some tool this turn, without naming which. any forces a tool call without naming one. A named tool uses type tool; letting the model decide is auto.
Your app connects to an MCP server over streamable HTTP. What must the client handle?
Show answer
Answer: Session handling and authentication for the remote server. Remote transport implies auth and sessions. Subprocess spawning is the stdio transport, not HTTP.
Which is a good tool description?
Show answer
Answer: 'Look up an order by order_id. Use when the user cites an order number. Returns status, items, shipping; errors on unknown id.'. Purpose, when to use, return shape, and error behavior. The second option is over-broad and will draw calls the tool cannot serve.
How should a tool report that a required parameter was missing?
Show answer
Answer: Return an error result naming the missing parameter. Name the problem so the model can fix the call. A silent default hides the mistake.
An API key was committed to a public repository. First action?
Show answer
Answer: Rotate the key, remove it from the code, then audit recent usage. Exposed credentials are rotated, not hidden. Rewriting history does not recall clones and forks that already have the key.
Which practice limits damage from prompt injection in a document-processing app?
Show answer
Answer: Restrict which actions document content can trigger and confirm side effects. Limit what content can cause. A filtering pass can be bypassed; the action gate holds regardless.
User data appears in your logs in plain text. What should change?
Show answer
Answer: Redact or minimize personal data in logs and set a retention policy. Minimize and govern what you store. Encryption and access limits protect the copy but do not reduce what is collected.
Which file gives Claude Code standing instructions for a repository?
Show answer
Answer: CLAUDE.md at the repository root or in .claude. CLAUDE.md is the project memory file. settings.json holds permissions and configuration, not instructions.
How do you run Claude Code for a single non-interactive prompt in a script?
Show answer
Answer: Run claude -p with the prompt as an argument. Print mode (-p) is headless. Calling the API directly skips Claude Code's tools and project context.
Drill one domain at a time
Each domain with enough questions has its own page with study notes and just that domain's questions.
How the real CCDV-F exam differs
- Questions: 53 items in 120 minutes
- Passing score: 720 on a 100–1,000 scale
- Exam fee: $125 per attempt, per the current exam guide
- Format: Proctored and closed-book, no AI assistance
- Delivered by Pearson VUE, online proctored or at a test center, with no notes and no AI assistance.
Practice question FAQ
Are these real CCDV-F exam questions?+
No. They are original questions written from the published blueprint and public API documentation, not exam content.
How many questions are on the real CCDV-F exam?+
53 questions in 120 minutes, proctored and closed-book, with a passing score of 720 on a 100 to 1,000 scale.
What should I study most for CCDV-F?+
Applications and integration, which is a third of the marks: the Messages API, stop reasons, streaming, batches, caching, and error handling. Model selection is next at about 17%.
Where do I register for CCDV-F?+
Through the Anthropic Partner Academy, via a Claude Partner Network organization such as YAID, then Pearson VUE.



