CCDV-F sample questions with answers
10 questions from the Claude Certified Developer – Foundations practice bank, spread across its domains. Pick your answer, then open the explanation to see why each option is right or wrong.
- Question 1Applications and Integration
A developer submits a Message Batch of 5,000 product-description requests and, once processing_status is "ended", writes result i to database row i. Several descriptions end up on the wrong products, and a few results have type "expired". What should the developer change?
- A
Sort the results by creation time before writing them, then retry expired items in the same batch.
- B
Give each request a unique custom_id, join results on it, and resubmit expired ones in a new batch.
- C
Split the work into batches of 100 so the results come back in submission order.
- D
Stream the batch results with the SSE streaming parameter so each result arrives as it completes.
Show the answer and explanation
Answer: B
Each batch request carries a custom_id, and results must be matched on it because they are not returned in submission order. Each result has a type of succeeded, errored, canceled or expired; expired requests hit the 24-hour window before processing, are not billed, and need resubmitting. Results can be downloaded for 29 days after the batch is created.
Why the other options are wrong
A. Results carry no reliable per-request ordering to sort on, and a batch that has ended cannot accept new requests.
C. Batch size does not guarantee ordering; results may be returned in any order at any size.
D. Batch requests cannot use SSE streaming; results are retrieved after processing, and the ordering problem remains.
- A
- Question 2Model Selection and Optimization
A web app must display Claude's answer in the browser as it is generated. The API key must never reach the client. Which architecture best fits?
- A
The backend makes a streaming request (server-sent events) and relays text deltas to the browser over its own SSE or WebSocket connection.
- B
The browser opens a WebSocket connection directly to the Messages API, authenticating with a restricted key embedded in the front-end bundle.
- C
The backend polls the Messages API every second to fetch the partially generated text for the request.
- D
Submit each question to the Message Batches API and have the browser poll the batch status until it ends.
Show the answer and explanation
Answer: A
Streaming responses from the Messages API arrive as server-sent events. A backend should consume that stream (the SDK handles SSE parsing) and forward deltas to the browser over whichever channel the app uses, so credentials stay server-side and users see progressive output.
Why the other options are wrong
B. The API streams over SSE rather than WebSockets, and shipping the key to the browser exposes it to anyone.
C. There is no endpoint that returns partial output of an in-flight message; streaming is how incremental output is delivered.
D. Batches are asynchronous and not suited to interactive, token-by-token display.
- A
- Question 3Agents and Workflows
A coding agent must find the root cause of a production error by scanning roughly 200 large log files, then fix the code. When it reads the logs itself, its context fills with log text and it loses track of the codebase details it needs for the fix. What should the developer do?
- A
Tell the agent to read the logs more quickly and skip lines it considers unimportant.
- B
Load all 200 logs into the first prompt so the agent sees everything before it starts working on the fix.
- C
Delegate the log search to a subagent that uses its own context and returns a concise summary.
- D
Increase max_tokens so the agent has more room for the logs and the fix.
Show the answer and explanation
Answer: C
The subagent pattern isolates noisy, high-volume work, such as log scans, broad searches or test runs, in a separate context and returns a distilled result. The main agent keeps its context for the reasoning and editing that follow.
Why the other options are wrong
A. Skimming still pulls large volumes of log text into the same context and relies on the model to discard it.
B. Front-loading the logs makes the context problem worse and may exceed the context window outright.
D. max_tokens limits output length; it does not enlarge the context window or reduce what the logs consume.
- A
- Question 4Prompt and Context Engineering
A research agent must review 40 long reports and produce one comparative brief. Running it as a single loop fills the context with raw report text, and the final brief misses cross-report patterns. What architecture best addresses this?
- A
An orchestrator delegates each report to a subagent with its own context, and each returns a condensed summary for synthesis.
- B
Concatenate all 40 reports into one very large prompt and ask for the brief in a single request to the most capable model.
- C
Process the reports one at a time in the same loop, deleting each report after reading without keeping notes.
- D
Split the 40 reports across several parallel agents that each write part of the final brief independently, with no synthesis step.
Show the answer and explanation
Answer: A
Context isolation through subagents or multi-step workflows keeps each unit of heavy work in its own context and passes only distilled results upward. The orchestrator then synthesizes over compact summaries, which avoids bloat and improves cross-cutting analysis.
Why the other options are wrong
B. One giant context repeats the bloat problem and makes it harder, not easier, to find cross-report patterns.
C. Dropping content with no notes loses the information needed for the comparison.
D. Without a synthesis step, nobody sees across reports, so cross-report patterns are still missed.
- A
- Question 5Tools and MCPs
Engineers want Claude, both in Claude Code and in the company's internal chat assistant, to answer questions like "what version is deployed to staging right now?" from the internal deployment service's REST API. A teammate proposes a Skill containing the API documentation and a table of current deployments that a nightly job regenerates. Which approach fits best?
- A
Use the Skill as proposed, because Skills load only when relevant and keep the context window small.
- B
Put the deployment table in the project CLAUDE.md and regenerate it every hour with a scheduled job.
- C
Build an MCP server that exposes deployment queries as tools, and connect both Claude clients to it.
- D
Define a custom tool in each of the two clients that calls the deployment API directly.
Show the answer and explanation
Answer: C
Skills package procedures and reference knowledge; they are not a source of live data. When several Claude clients need current information from an external system, an MCP server exposes it once as tools that every client can use. A Skill can still complement it, for example with the team's rollout procedure.
Why the other options are wrong
A. On-demand loading does not make a nightly snapshot current; answers could be up to a day out of date.
B. The table is still a stale copy, it loads into every session, and it does not reach the chat assistant.
D. This returns live data but duplicates the integration in every client, which MCP avoids.
- A
- Question 6Security and Safety
A team adds an MCP server named
paymentsand wants a PreToolUse hook to inspect every call to it. They configure the matcher asmcp__payments. The server's tools (mcp__payments__refund,mcp__payments__lookup) run without the hook ever firing, while a matcher ofBashon the same hook works. What is wrong?- A
A matcher made only of letters, digits and underscores is compared as an exact string, so
mcp__paymentsmatches no tool; usemcp__payments__.*. - B
MCP tools do not fire PreToolUse at all; the hook must be registered on the PermissionRequest event, which is the event MCP servers go through.
- C
MCP tool names in hook matchers use a single underscore between segments, so the matcher should be written as
mcp_paymentsto match the server. - D
Hooks for MCP tools must be declared inside the server's
.mcp.jsonentry rather than in settings, so the settings hook is ignored for that server.
Show the answer and explanation
Answer: A
Hook matchers are exact strings when they contain only exact-match characters and regular expressions otherwise. To cover every tool from an MCP server, match the prefix with
.*appended (mcp__<server>__.*); a bare server prefix is an exact match that fits no real tool name.Why the other options are wrong
B. MCP tools appear as regular tools in PreToolUse and PostToolUse and can be matched like any other tool name.
C. The naming pattern is mcp__<server>__<tool> with double underscores; changing the separator would still be an exact match that fits no tool.
D. Hooks are configured in settings files, managed settings, plugins or skill frontmatter; .mcp.json defines servers, not hooks.
- A
- Question 7Claude Code
A monorepo's CLAUDE.md has grown to about 800 lines. It covers frontend conventions, backend API rules, and several long runbooks. Developers report that Claude follows instructions less reliably and that frontend rules clutter backend sessions. Which two changes best address this? (Choose two.)
Choose 2.
- A
Split the file into several documents and pull them back in with @path imports.
- B
Move area-specific guidance into .claude/rules/ files that use paths frontmatter.
- C
Move the whole file to ~/.claude/CLAUDE.md so it no longer counts against the project.
- D
Turn the long runbooks into skills that load on demand, and keep CLAUDE.md short.
- E
Convert the instructions into keys in .claude/settings.json so they are enforced.
Show the answer and explanation
Answer: B and D
Large CLAUDE.md files consume context and reduce adherence. Keep always-on instructions concise, scope area-specific guidance with path-based rules, and move procedures into on-demand skills. Imports help organization but do not reduce what loads at launch.
Why the other options are wrong
A. Imported files are expanded and loaded at launch, so the same content still fills the context.
C. User-level instructions still load into every session, and the team would lose the shared, versioned file.
E. settings.json configures permissions, hooks, models and similar options; it is not a place for natural-language coding conventions.
- A
- Question 8Eval, Testing, and Debugging
An agent loop sometimes ends with an empty reply. Traces show that each empty response has stop_reason "end_turn" and no content, and that it always follows a user message in which the app sends the tool_result block followed by a text block saying "Here is the tool output." Tool results themselves are correct. What should the developer change?
- A
Retry the request unchanged whenever the reply is empty, up to three times.
- B
Send only the tool_result blocks in that user message, with no text block after them.
- C
Raise max_tokens, because the model is running out of room before it can write the reply.
- D
Switch to a larger model, because the current one cannot interpret the tool output.
Show the answer and explanation
Answer: B
Isolate the origin before choosing a fix. Here the tool output is correct and the pattern follows a specific message structure the app builds, so the defect is in the integration layer. The docs note that adding text blocks immediately after tool_result blocks can cause empty end_turn responses. If empty replies persist after fixing the structure, add a new user message asking Claude to continue rather than resending the same history.
Why the other options are wrong
A. Claude has already judged the turn complete from this history, so resending the same messages tends to produce the same empty result.
C. Running out of room is reported as stop_reason "max_tokens"; here Claude ended its turn deliberately with "end_turn".
D. The trace points to how the app structures messages, not to model capability, and the same structure can trigger the behavior on any model.
- A
- Question 9Applications and Integration
Claude Code delivers a single 2,400-line pull request that renames a module, reformats 40 files, fixes a bug in date handling, and adds a new export feature. Reviewers cannot tell which lines matter, and the fix is urgently needed. What should the developer ask for?
- A
Separate small PRs: the bug fix first, then the rename, the formatting-only change, and the feature, each with tests.
- B
Have Claude Code review its own pull request and post a summary of risks.
- C
Squash-merge the PR so the history stays clean, then revert if problems appear.
- D
A detailed PR description explaining each of the four parts, with links to the relevant files, so reviewers can navigate the large diff.
Show the answer and explanation
Answer: A
Version-control hygiene with AI-generated changes means small, single-purpose PRs: behaviour changes separate from refactors and formatting, each with tests. That keeps review meaningful and lets the urgent change ship, bisect and revert independently.
Why the other options are wrong
B. The author session reviewing itself does not restore the human's ability to see what changed.
C. One squashed commit makes the four changes inseparable; a revert would also remove the urgent fix and the feature.
D. Helps navigation but leaves reviewers reading behaviour changes buried in formatting noise, and everything still ships or reverts together.
- A
- Question 10Model Selection and Optimization
A routing service builds request parameters (thinking type, effort level, structured output) from a hand-maintained table of what each model supports. Every model release causes 400 errors in production until someone edits the table and redeploys. Which change removes this class of incident?
- A
Read the usage object on each response to learn which features the model actually applied.
- B
Query the Models API at startup and derive each model's parameters from the capabilities it reports.
- C
Pin the service to one model permanently so the capability table never has to change again.
- D
Send the full parameter set to every model, catch the 400, and retry without whichever parameter the error message names as unsupported.
Show the answer and explanation
Answer: B
The Models API lists each model with a capabilities object covering features such as batch, citations, structured outputs, thinking types and supported effort levels. Building requests from that live data lets a selection layer adapt to new models without a redeploy.
Why the other options are wrong
A. The usage object reports token consumption, not capability, and it only arrives after a request has already succeeded.
C. This trades an operational problem for stagnation, and the pinned model will eventually be deprecated and retired anyway.
D. This discovers capabilities by failing in production, spends an extra round trip, and depends on parsing error messages that are not a stable interface.
- A
Practise all 657 CCDV-F questions
Start with the free 15-question diagnostic. It shows where to focus, and your results carry over if you sign up.