01-projects/phdata

CCDV-F practice quiz 1 (50 items, gap-weighted)

2026-10-20·quiz·status: active·source: CCDV-F exam guide v1.0 (July 2026) for domains/weights; keys verified against live docs 2026-10-20
phdatacertanthropicccdv-foundationsquizcert-prep

CCDV-F practice quiz 1

50 scenario items. Domain mix follows the exam guide weights, tilted toward the red/yellow gaps (D2 API mechanics, D5, D8 MCP). Multiple-response items say how many to select, like the real exam. Questions first; answer key, explanations and doc links at the bottom. Interactive version: https://ccdv-quiz.rdco.dev

Companion notes: [[2026-10-20-ccdv-f-readiness]] (domain-by-domain readiness and the prep plan this quiz is weighted against) and [[2026-10-20-ccdv-f-study-sheet]] (the same red/yellow topics as reference facts). Progress tracked in [[cert-progress]].

Domain counts: D1 6, D2 15, D3 2, D4 3, D5 9, D6 5, D7 4, D8 6

Questions

Q1 · D2 Applications and Integration

A nightly job submits 40,000 summarization requests through the Message Batches API, then writes each result back to the database by its array position in the results file. QA finds about 1% of summaries attached to the wrong record. What is the correct fix?

Q2 · D5 Model Selection and Optimization

A support bot on claude-sonnet-5-5 sends a 6,000-token system prompt marked with cache_control. Its first line is "Current time: {now}", rendered to the second. usage.cache_read_input_tokens is 0 on every request. What fixes this with the smallest change?

Q3 · D8 Tools and MCPs

You are building an MCP server for an incident-response team. They want a reusable "postmortem draft" template that a person explicitly picks from a menu in their client, with arguments such as the incident ID. Which MCP primitive fits?

Q4 · D2 Applications and Integration

Your streaming handler reads stop_reason and output token usage from the message_start event. Your dashboard now shows stop_reason as null for every request. Where do these values actually arrive?

Q5 · D5 Model Selection and Optimization

A team swaps claude-opus-5 for claude-opus-5-5 and changes nothing else. On a hard multi-step coding eval, scores drop, responses get shorter, and the model makes fewer tool calls. What is the most likely cause?

Q6 · D1 Agents and Workflows

A team handles invoices with a working three-call prompt chain: extract, validate against the ERP, then draft an approval email. A pilot on real traffic finds the hard part: which ERP lookups, vendor queries and clarification steps an invoice needs varies widely and cannot be predicted from the invoice up front. Which approach fits that last finding?

Q7 · D2 Applications and Integration

Your app calls claude-opus-5-5, which has a 1M-token context window. Which TWO statements about context-window limits are correct? (Select 2.)

Q8 · D6 Prompt and Context Engineering

Legacy code prefills the assistant turn with "{" to force JSON output. After a move to claude-sonnet-5-5, every request returns a 400. You need schema-valid JSON on every successful response. What should replace the prefill?

Q9 · D7 Security and Safety

An agent summarizes arbitrary web pages and also holds a send_email tool. A red-team page hides text telling the model to email the customer list to an outside address. Which control most reliably prevents the exfiltration?

Q10 · D2 Applications and Integration

A request to claude-opus-5-5 returns 400 invalid_request_error. Which TWO of these settings does this model reject? (Select 2.)

Q11 · D5 Model Selection and Optimization

A ticket router labels 2 million tickets a day into 12 queues and runs on claude-opus-5-5 at high effort. An offline eval on 2,000 labeled tickets scores claude-haiku-5-5 at low effort at 96.8% against Opus's 97.1%. The business acceptance bar is 96%. Which configuration should production use?

Q12 · D8 Tools and MCPs

Your inventory tool times out while Claude is midway through a task. What should your agent loop send back to the API?

Q13 · D4 Eval, Testing, and Debugging

During a launch you see a burst of HTTP 529 responses. On the calls that do succeed, the anthropic-ratelimit-*-remaining headers show plenty of headroom. What is the right reading and response?

Q14 · D2 Applications and Integration

A QA tool sends 30 phone screenshots in one Messages API request. Each is 2400 x 3200 px and well under 10 MB. The API returns invalid_request_error. The team wants to keep all 30 screenshots in one request. What fixes it?

Q15 · D3 Claude Code

A GitHub Actions step must run Claude Code non-interactively on a PR diff, and the next step needs to parse the result. Which invocation fits?

Q16 · D5 Model Selection and Optimization

Before sending a 900K-token document bundle to claude-opus-5-5, a service calls POST /v1/messages/count_tokens to decide whether to split it. Which statement about that call is accurate?

Q17 · D1 Agents and Workflows

A CI agent built on the Claude Agent SDK must never be able to run shell commands. The developer set allowed_tools=["Read", "Grep", "Glob"] and is surprised that Claude still attempts Bash calls. What change enforces the requirement?

Q18 · D2 Applications and Integration

A service on claude-opus-5-5 uses messages.create for chat and the Message Batches API for nightly jobs. It must move to Amazon Bedrock. Which TWO changes are required? (Select 2.)

Q19 · D6 Prompt and Context Engineering

A long-running research agent on the Claude API calls a search tool hundreds of times. Old search results dominate the context and answer quality degrades late in the run. Which API feature targets exactly this problem?

Q20 · D2 Applications and Integration

Every night a team re-scores 50,000 archived support transcripts with claude-sonnet-5-5 for a dashboard analysts read the next morning. A Python script runs them through AsyncAnthropic with a semaphore; it finishes in 3 hours but eats rate limit that the daytime chat product shares. Cost matters most. What should change?

Q21 · D5 Model Selection and Optimization

A contract-analysis feature runs claude-sonnet-5-5 at effort medium. An eval on 300 hard multi-clause cases scores 81% against a 90% target. The misses are multi-step reasoning errors, not formatting, and the latency budget allows about twice the current response time. What should the team try first?

Q22 · D8 Tools and MCPs

Your local stdio MCP server works when tested on its own, but Claude Code reports parse errors and drops the connection whenever one of its tools runs. The tool code calls print() to log progress. What is the fix?

Q23 · D2 Applications and Integration

Which TWO statements about the Message Batches API are accurate? (Select 2.)

Q24 · D7 Security and Safety

A mobile app needs Claude features. A developer proposes embedding a workspace API key in the app binary, obfuscated, with a low spend limit on that workspace. What is the right design?

Q25 · D2 Applications and Integration

A long agent session on claude-opus-5-5 has 300K tokens of cached history. Mid-session, the operator must add a rule: "write all SQL as parameterized queries." The app must keep its cache hits and give the rule operator-level priority. How should it add the rule?

Q26 · D2 Applications and Integration

A long streaming response from claude-opus-5-5 drops at about 70% because of a network error. The text received so far was saved. The team wants to avoid paying to regenerate the whole answer. What do the streaming docs recommend for this model?

Q27 · D1 Agents and Workflows

A healthcare client wants a long-running coding agent with its own sandbox, scheduled runs, and persisted session history. The team likes Claude Managed Agents for this. The final line of the security review says every Claude request must run under Zero Data Retention. Which deployment fits?

Q28 · D2 Applications and Integration

A legal app sends one 800-page, 25 MB contract PDF as a base64 document block to claude-opus-5-5 and gets a 400. What is the most direct fix?

Q29 · D6 Prompt and Context Engineering

You send claude-opus-5-5 about 150K tokens across five contracts, plus the instruction "List every indemnity clause that conflicts with the master agreement." Which prompt layout do the docs recommend?

Q30 · D8 Tools and MCPs

Your team has a 40-step internal procedure for preparing quarterly compliance packets, with two helper scripts and a template. It should load only when relevant and work in both Claude Code and the API. Which customization fits best?

Q31 · D5 Model Selection and Optimization

An analyst tool on claude-opus-5-5 reuses a 100K-token prefix, but requests arrive about every 20 minutes. With the default cache, every call pays a fresh cache write. Which change is cheapest, and why?

Q32 · D2 Applications and Integration

A TypeScript backend serves a live chat feature: up to 300 users type at once, and each expects tokens on screen within a second or two. A teammate proposes routing every request through the Message Batches API to halve the bill. What is the right design?

Q33 · D4 Eval, Testing, and Debugging

In production, about 3% of responses fail JSON parsing. Logs show that every failing response has stop_reason "max_tokens" and ends mid-object. Where is the fault, and what is the fix?

Q34 · D6 Prompt and Context Engineering

Your code reads response.content[0].text from claude-sonnet-5-5. Now and then it gets an HTTP 200 whose content has no usable answer, and downstream parsing crashes. What should the handler check first?

Q35 · D1 Agents and Workflows

A due-diligence agent must review 60 vendor contracts and report risks. Run as one loop, its context fills with contract text and its later findings degrade. Which architecture best addresses this?

Q36 · D7 Security and Safety

A team adds a Claude Code PreToolUse hook with matcher "Write|Edit" that exits with code 2 whenever the target path is .env. Later, Claude modifies .env anyway. What most likely happened?

Q37 · D2 Applications and Integration

Claude returns one assistant message with three tool_use blocks. Your loop sends back three separate user messages, each with one tool_result. Over time Claude stops making parallel calls. What is the correct pattern?

Q38 · D5 Model Selection and Optimization

After a reasoning UI moves from claude-sonnet-4-6 to claude-opus-5-5, the panel that showed Claude's reasoning is blank. Thinking blocks still arrive, and output token usage has not dropped. What explains it?

Q39 · D8 Tools and MCPs

You want a Messages API app to use tools from an MCP server through the MCP connector, with no client-side MCP code. Which TWO statements are accurate? (Select 2.)

Q40 · D2 Applications and Integration

A hand-written tool-use loop on claude-sonnet-5-5 with adaptive thinking builds each assistant turn for history by copying only the text and tool_use blocks from the response. Thinking blocks look empty anyway under the default display, so it drops them to save tokens. What do the thinking docs say about this loop?

Q41 · D3 Claude Code

A developer wants Claude Code to know their personal sandbox URL and test-fixture path for one repository only, without committing it for teammates. Where should it go?

Q42 · D1 Agents and Workflows

An Agent SDK agent must write an audit record for every tool call it makes, including the inputs, with no exceptions. What is the most reliable implementation?

Q43 · D5 Model Selection and Optimization

A chat product runs claude-opus-5-5 with streaming. A PM proposes turning on fast mode to fix user complaints, and asks whether it will help. The complaint log is specific: users wait too long before the first word appears, and once text starts flowing they find the speed fine. What should you tell the PM?

Q44 · D2 Applications and Integration

Your app streams responses that include tool calls. Which TWO statements about the event stream are accurate? (Select 2.)

Q45 · D6 Prompt and Context Engineering

A ticket extractor on claude-haiku-5-5 must return the product name in the company's exact casing ("DataHub Pro", never "Datahub pro") and output UNKNOWN when no product is mentioned. An eval scores 91% against a 97% target, and nearly every miss is a casing error or a no-product ticket. The prompt already has three paragraphs of rules on both. What should the team try first?

Q46 · D4 Eval, Testing, and Debugging

A CI test asserts that the ticket summarizer's output equals a stored golden string. It fails on most runs even when the summaries are good. What should replace it?

Q47 · D7 Security and Safety

A team connects a GitHub MCP server to an agent that only needs to read issues in one repository. The quickest setup uses a developer's personal token with full repo and admin scopes. What should they do instead?

Q48 · D8 Tools and MCPs

An agent has two tools, search_orders and search_order_history, each with a one-line description. Traces show Claude picks the wrong one about 30% of the time. What change does the tool-definition guidance stress most?

Q49 · D1 Agents and Workflows

A Claude Agent SDK job in CI behaves differently from local runs: it follows instructions from a developer's CLAUDE.md and project settings files. The job should load no filesystem settings at all. What change does that?

Q50 · D5 Model Selection and Optimization

A cost model for moving a summarization service from claude-sonnet-4-6 to claude-opus-5-5 reuses token counts measured on Sonnet 4.6. Actual input bills come in roughly 30% above forecast, even after the price change is applied. Why?

Answer key

Q1: C · D2 Applications and Integration

The batch docs say results can be returned in any order and that you should always match them by custom_id. custom_id must be unique within the batch and match ^[a-zA-Z0-9_-]{1,64}$.

Q2: A · D5 Model Selection and Optimization

Caching is an exact prefix match over tools, then system, then messages. A value that changes on every request near the top of the system prompt changes the prefix, so no request can ever read the cache. Keep volatile content after the last breakpoint.

Q3: C · D8 Tools and MCPs

The MCP spec splits control: tools are model-controlled, resources are application-driven, and prompts are user-controlled templates that a user explicitly selects (prompts/list, then prompts/get with arguments).

Q4: B · D2 Applications and Integration

message_start contains a Message with empty content and stop_reason null. Top-level changes such as stop_reason arrive in one or more message_delta events, and the usage counts in message_delta are cumulative.

Q5: A · D5 Model Selection and Optimization

The effort docs say most models default to high, but Claude Opus 5.5 and Claude Haiku 5.5 default to medium. Lower effort means fewer tool calls and terser output, so set output_config.effort explicitly (high or xhigh) for intelligence-sensitive agentic work.

Q6: D · D1 Agents and Workflows

Workflows fit when the steps are known; agents fit open-ended tasks whose steps cannot be specified in advance. The last sentence makes the path unpredictable, so a tool-using agent is justified, with a deterministic approval gate on the one risky action.

Q7: A, D · D2 Applications and Integration

The context-windows page says an input that alone exceeds the window gets a 400 on every model. On Claude 4.5 models and newer, input plus max_tokens may exceed the window; if generation hits the limit it stops with stop_reason model_context_window_exceeded, which you treat as truncated output.

Q8: A · D6 Prompt and Context Engineering

Claude 4.6 and later models reject a prefilled final assistant turn with a 400. Structured outputs (output_config.format with json_schema) constrain the response to your schema, but a refusal or max_tokens stop can still produce non-conforming output, so check stop_reason first.

Q9: C · D7 Security and Safety

Treat fetched content as untrusted and enforce least privilege outside the model. An allowlist plus an approval gate on the sensitive tool holds even if the injection fully succeeds, which a prompt rule or a model swap cannot promise.

Q10: B, E · D2 Applications and Integration

The Opus 5.5 migration guide lists forced tool use (any or tool) and non-default sampling parameters among the settings that return a 400. Steer tool use with auto plus strict tools or structured outputs, and steer style through the prompt.

Q11: D · D5 Model Selection and Optimization

Move down a tier when an eval shows the drop is acceptable. Haiku 5.5 costs $0.10/$0.50 per MTok (prompts up to 100K) versus $4/$20 for Opus 5.5, and the effort docs recommend low for high-volume or latency-sensitive work. Routing is a classification task, where extra reasoning is mostly wasted.

Q12: C · D8 Tools and MCPs

Every tool_use needs a matching tool_result. Report a failure with is_error: true and a message the model can act on, so it can retry, adjust inputs or change approach.

Q13: B · D4 Eval, Testing, and Debugging

529 overloaded_error means the API is temporarily overloaded and is not about your own limits, so back off and retry. 429 rate_limit_error is the code for your organization's limits and carries retry-after.

Q14: B · D2 Applications and Integration

Vision docs: up to 8000 x 8000 px per image, but with more than 20 image and document blocks in a request, neither dimension may exceed 2000 px. The last line rules out splitting the request, so downscale.

Q15: B · D3 Claude Code

-p (or --print) runs Claude Code non-interactively, and --output-format accepts text (the default), json or stream-json. The docs also recommend --bare for scripted calls.

Q16: D · D5 Model Selection and Optimization

The token-counting page says the endpoint is free, rate-limited per tier on its own, returns an estimate that can differ slightly from actual usage, and does not use caching. It accepts system prompts, tools, images and PDFs.

Q17: C · D1 Agents and Workflows

In the Agent SDK, allowed_tools lists tools to auto-approve without prompting; it does not hide other tools. A bare name in disallowed_tools, such as "Bash", removes that tool from Claude's context entirely.

Q18: C, E · D2 Applications and Integration

For Opus 4.7 and later, Bedrock serves the Messages API at a bedrock-mantle endpoint through the AnthropicBedrockMantle client, AWS auth and anthropic.-prefixed model IDs. The Bedrock page lists Message Batches among the unsupported API endpoints.

Q19: A · D6 Prompt and Context Engineering

Context editing (beta header context-management-2025-06-27) clears older tool results server-side once context grows past a threshold. It invalidates the cached prefix where it clears, so use clear_at_least to make each clear worthwhile.

Q20: B · D2 Applications and Integration

Offline, latency-tolerant, high-volume work is the Batches case: submit, receive an ID, poll processing_status, then read results in any order by custom_id. Batches cost 50% of standard prices, usually finish within an hour (24-hour maximum), keep results for 29 days, and have their own rate limits.

Q21: C · D5 Model Selection and Optimization

Effort is the main control for how much the model thinks, and reasoning pays off on hard multi-step problems. Sonnet 5.5's effort levels were recalibrated, so the docs say to run a fresh effort sweep on your evals. Raise effort first; change tier only if the eval still misses.

Q22: D · D8 Tools and MCPs

The stdio transport spec says the server MUST NOT write anything to stdout that is not a valid MCP message and MAY write UTF-8 logs to stderr. The TypeScript tutorial warns against console.log for the same reason.

Q23: A, C · D2 Applications and Integration

Batch docs: up to 100,000 requests or 256 MB per batch; most finish within an hour; anything unprocessed after 24 hours expires and is not billed; results are available for 29 days at 50% of standard prices.

Q24: A · D7 Security and Safety

Any secret shipped to a client can be extracted. Keep API keys server-side, injected from a secrets manager or environment variables, authenticate end users at your backend, and apply per-user authorization and rate limits there.

Q25: D · D2 Applications and Integration

Mid-conversation system messages (supported on Opus 5.5 with no beta header) add an operator instruction without changing the cached prefix. Editing the top-level system field re-processes the system prompt and every cached message after it.

Q26: B · D2 Applications and Integration

Streaming error recovery: capture the partial response, then for Claude 4.6 and later send a new request whose user message contains the partial response and asks the model to continue ("Your previous response was interrupted and ended with ..."). Resume from the most recent text block.

Q27: B · D1 Agents and Workflows

Managed Agents stores conversation history, sandbox state and outputs server-side by design and is not currently ZDR-eligible. The Agent SDK runs in a process you operate, so retention follows your own API organization's settings.

Q28: A · D2 Applications and Integration

PDF docs: 32 MB per request and 600 pages, or 100 pages when the request's context window is under 1M tokens. 25 MB is under the size cap, so the page count is the problem.

Q29: A · D6 Prompt and Context Engineering

Prompting best practices: put longform data at the top, above the query, instructions and examples; queries at the end can improve quality by up to 30% on complex multi-document inputs. Wrap each document in tags with <document_content> and .

Q30: B · D8 Tools and MCPs

Skills use progressive disclosure: metadata is always loaded, the SKILL.md body loads when triggered, and bundled scripts and files load as needed. That matches "load only when relevant" and works across Claude surfaces.

Q31: C · D5 Model Selection and Optimization

Caching pricing: 5-minute writes cost 1.25x base input, 1-hour writes cost 2x, and reads cost 0.1x on most models but 0.05x on Opus 5.5 and Sonnet 5.5 (0.025x on Fable 5.1). A 20-minute gap outlives the default TTL, so the 1-hour TTL turns repeated writes into cheap reads.

Q32: D · D2 Applications and Integration

Real-time, concurrent, user-facing work belongs on the regular Messages API. In TypeScript the standard client is Promise-based (Python adds a separate AsyncAnthropic class), streaming uses server-sent events over the same HTTP connection, and the SDK retries 429 and 5xx errors with backoff. Batches trade latency for a 50% discount and suit offline jobs.

Q33: A · D4 Eval, Testing, and Debugging

stop_reason max_tokens means generation hit your max_tokens cap, so the output is truncated by configuration, not malformed by the model. Checking stop_reason first separates integration faults from model-output faults.

Q34: A · D6 Prompt and Context Engineering

refusal is a stop_reason returned with HTTP 200, and stop_details carries a category and explanation only in that case. Always branch on stop_reason, and read content blocks by type: with thinking on, content[0] may be a thinking block, not text.

Q35: C · D1 Agents and Workflows

Subagents isolate context: each reads one document in a clean window and returns only a condensed result, so the orchestrator's context stays small. This is the context-isolation pattern the guide names under Context Engineering.

Q36: C · D7 Security and Safety

Exit code 2 from a PreToolUse hook blocks the call, but the matcher filters by tool name, so a Write|Edit matcher never fires for Bash. Add a Bash matcher that inspects the command, add deny rules, or protect the file outside Claude.

Q37: D · D2 Applications and Integration

Send all tool_result blocks for one assistant turn in a single user message, with tool_result blocks first and any text after them. Splitting results across messages discourages Claude from making parallel calls.

Q38: D · D5 Model Selection and Optimization

On Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.1 and Opus 4.7/4.8, display defaults to "omitted" and the thinking field is empty; "summarized" returns a summary. Thinking is billed as output tokens in full either way.

Q39: B, D · D8 Tools and MCPs

The MCP connector needs both halves: an mcp_servers entry (type url, url, name, optional authorization_token) and an mcp_toolset entry in tools. The server must be publicly reachable over HTTP, and only tool calls are supported.

Q40: D · D2 Applications and Integration

When Claude calls a tool it pauses mid-response, so its earlier reasoning must still be present when you return the result. The docs say to pass every thinking block (and redacted_thinking block) back complete and unmodified. Outside tool use, older-turn thinking blocks may be omitted.

Q41: C · D3 Claude Code

Claude Code memory docs: CLAUDE.local.md holds personal, project-specific preferences and should be gitignored. ~/.claude/CLAUDE.md applies to all your projects, and ./CLAUDE.md or ./.claude/CLAUDE.md is shared with the team.

Q42: B · D1 Agents and Workflows

Hooks run your code deterministically at lifecycle events such as PreToolUse and PostToolUse, so the audit does not depend on the model choosing to comply. The guide calls this "hooks for deterministic actions."

Q43: D · D5 Model Selection and Optimization

Fast-mode docs: up to 2.5x higher output tokens per second; the gain is in output speed, not time to first token. On Opus 5.5 it is GA at $8/$40 per MTok, and it is not available with Batches, Bedrock or Google Cloud. The last line says output speed is already fine, so fast mode targets the wrong metric.

Q44: B, E · D2 Applications and Integration

Streaming docs: tool input streams as partial_json fragments to accumulate; ping events can appear anywhere; new event types may be added, so code should ignore unknown types; errors such as overloaded_error can arrive as stream events.

Q45: C · D6 Prompt and Context Engineering

The prompting docs call examples (few-shot or multishot) one of the most reliable ways to steer output format and structure; wrap them in tags and cover edge cases. Examples cost tokens on every call, so add the fewest that clear the eval; that can let the smaller model stay.

Q46: A · D4 Eval, Testing, and Debugging

The eval docs say to choose the fastest, most reliable, most scalable grading method: code-based checks for rule-based properties, LLM-based grading with detailed rubrics for nuanced judgments, and human grading only when needed. Free-text summaries vary in wording, so check properties and grade meaning.

Q47: A · D7 Security and Safety

Least privilege: grant only the permissions the task needs and keep credentials out of files. The MCP authorization spec says stdio servers should retrieve credentials from the environment rather than follow the HTTP OAuth flow.

Q48: B · D8 Tools and MCPs

The docs call extremely detailed descriptions "by far the most important factor in tool performance": what the tool does, when to use it and when not to, what each parameter means, and caveats. Consolidating related operations is a secondary tip.

Q49: D · D1 Agents and Workflows

The Agent SDK migration guide says omitting settingSources loads user, project and local filesystem settings, including CLAUDE.md, matching the CLI. Pass an empty list to isolate the run.

Q50: B · D5 Model Selection and Optimization

The token-counting docs say Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text, so counts from older models cannot be reused. Characters per token depends on the tokenizer, so count with the model you will run.