# CCDV-P Practice Questions (Free, 2026) | Your AI Department

> 92 free scenario-based CCDV-P practice questions for Claude Certified Developer – Professional, with explanations, weighted by the published exam blueprint.

Source: https://youraidept.com/network/ccdv-p-practice-questions

Want the real thing? [Take the timed CCDV-P practice exam](https://youraidept.com/network/ccdv-p-practice-exam): 70 questions in 120 minutes, with an estimated score against the 720 pass mark and a domain breakdown.

## 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 gives an estimated score on the program’s 100 to 1,000 scale and tells you whether it reaches the 720 pass mark; if it does not, the domains you missed are your reading list. The estimate is ours, not Anthropic’s scoring: Anthropic has not published how it scales results, so we map percent correct onto the scale in a straight line, which puts 720 at about 69% correct. The full domain-by-domain notes are on [the CCDV-P exam page](https://youraidept.com/network/ccdv-p).

## The questions

All domains (92) Production integration, reliability, and knowledge grounding (20) Advanced agent architecture and orchestration (14) Observability and production monitoring (10) Evaluation engineering and quality assurance (12) Runtime guardrails and production security (10) Advanced debugging and incident response (9) Agent fleet operations for software delivery (10) Cost and latency optimization at scale (7)

Production integration, reliability, and knowledge grounding

A customer-facing service starts returning HTTP 429 on every Claude request halfway through the month. The SDK's automatic retries all fail, the responses carry no retry-after header, and the error details name an enforced spend limit rather than a per-minute rate limit. What should the integration do with this class of error?

- Treat it as non-retryable: stop retrying, open the circuit to a degraded path, and page the owner of the limit
- Rotate requests across several API keys from the same organization so that each key draws on its own allowance
- Raise the retry count and the backoff ceiling so that requests keep trying until the per-minute window refills
- Cut worker concurrency in half so that the request rate drops back under the organization's requests-per-minute limit

Check answer

### Show answer

Answer: Treat it as non-retryable: stop retrying, open the circuit to a degraded path, and page the owner of the limit. A spend-cap 429 is not a throughput problem: it has no retry-after header and keeps failing until the cap is raised or the month resets, so retries only add load and delay the degraded path. Limits are enforced at the organization level, so more keys do not help, and lowering concurrency addresses a per-minute limit that is not the one being hit.

Production integration, reliability, and knowledge grounding

During a provider-wide traffic spike, a summarization service receives 529 overloaded_error responses while its own rate-limit headers still show ample remaining capacity. The client retries every failure immediately, five times, and the retry storm takes down the service's own queue workers. Which design fits this failure?

- A request for higher input and output token limits, since overload errors mean the organization has outgrown its usage tier
- Bounded retries with exponential backoff and jitter, a circuit breaker that opens on sustained errors, and a degraded path
- Immediate failover of every request to a second API key, so that the overloaded key can recover while the other carries traffic
- A lower max_tokens on every request, so that each call reserves less output capacity and is less likely to be rejected

Check answer

### Show answer

Answer: Bounded retries with exponential backoff and jitter, a circuit breaker that opens on sustained errors, and a degraded path. 529 signals that the API is temporarily overloaded across users, not that this organization exceeded its limits, so the fix is to stop amplifying load: back off with jitter, cap retries, and let a breaker route to a queue, cache, or fallback until the errors clear. Tier increases and extra keys address rate limits that the headers show are not binding, and max_tokens does not reserve capacity.

Production integration, reliability, and knowledge grounding

A nightly enrichment job starts at 02:00 and immediately fires several thousand concurrent requests at a model the organization barely uses during the day. Many return 429 even though per-minute token usage stays far below the published input and output limits, and the error details name a ramp limit. What is the right fix?

- Shorten each prompt so that the job sends fewer input tokens per request and each request weighs less against the limit
- Add more workers and retry each 429 immediately, so that the job pushes through the limit before the nightly window closes
- Ask for a higher input-tokens-per-minute limit, since a 429 at this volume shows the job has reached the organization's token ceiling
- Start at a low rate and step traffic up gradually with evenly spaced requests, or move the work to the Message Batches API

Check answer

### Show answer

Answer: Start at a low rate and step traffic up gradually with evenly spaced requests, or move the work to the Message Batches API. A ramp limit caps how fast usage on a model can grow, so a cold start at full concurrency is rejected even when the per-minute limits have headroom. Ramping up gradually and spreading requests evenly clears it, and the Message Batches API is not subject to ramp limits. A higher token limit or shorter prompts target a ceiling the job never reached, and immediate retries make the burst sharper.

Production integration, reliability, and knowledge grounding

A retrieval service hits its input-tokens-per-minute limit at peak. Every request carries the same 40,000-token policy preamble followed by about 2,000 tokens of request-specific content, yet usage shows cache reads near zero for all but the busiest tenants, because the system prompt opens with a line naming the tenant and its plan. Which change raises throughput most without a limit increase?

- Move the tenant line after the shared preamble so it is read from cache, since cached reads do not count toward the limit
- Compress the preamble with a summarization pass on each request, so that every call sends a shorter version of the policy text
- Split the traffic across two workspaces in the same organization, so that each workspace draws on its own input-token limit
- Lower max_tokens on every request, so that less output capacity is reserved against the per-minute limit for each call

Check answer

### Show answer

Answer: Move the tenant line after the shared preamble so it is read from cache, since cached reads do not count toward the limit. Caching is a prefix match, so a tenant-specific first line gives every tenant its own prefix and the shared preamble is rarely reused. Once the preamble comes first and is read from cache, those tokens stop counting toward the input-tokens-per-minute limit on most models, which multiplies effective throughput and cuts cost. max_tokens does not factor into rate limiting, workspace limits can only subdivide the organization's limit, and summarizing per request adds a model call to every request.

Production integration, reliability, and knowledge grounding

An internal remote MCP server fronts the company's ticketing API. It accepts whatever bearer token the MCP client presents and forwards the same token to the ticketing API. A security review flags the design. What should change?

- The server validates that each token was issued for it as the audience, and calls the ticketing API with a credential of its own
- The server caches each forwarded token for a day, so that the ticketing API sees fewer authorization checks from the same client
- The server moves to the stdio transport, so that requests arrive over a local pipe and no bearer tokens are exchanged at all
- The client sends the token as a URL query parameter over TLS, so that the server can log and correlate which token made each call

Check answer

### Show answer

Answer: The server validates that each token was issued for it as the audience, and calls the ticketing API with a credential of its own. Under the MCP authorization model a remote server is an OAuth resource server: it must accept only tokens issued for it and must not pass a client's token through to a downstream API, which would turn it into a confused deputy. It uses its own credential for upstream calls. Tokens must not travel in query strings, caching forwarded tokens keeps the passthrough, and stdio does not fit a shared remote deployment.

Production integration, reliability, and knowledge grounding

A platform team's MCP server is used by three production agents. A release renames the customer_id parameter to account_id and narrows an enum. Within an hour all three agents show a jump in failed tool calls and invented arguments. Which practice would have prevented this?

- Relying on each agent to re-read the tool list at runtime, since the model adapts to whatever schema the server currently advertises
- Versioning tool schemas as contracts: additive changes in place, breaking ones as a new tool run side by side behind consumer evals
- Freezing the three agents' system prompts for the release, so that no other change could interact with the new schema
- Updating the tool description to mention both parameter names, so that the model learns that either one is acceptable

Check answer

### Show answer

Answer: Versioning tool schemas as contracts: additive changes in place, breaking ones as a new tool run side by side behind consumer evals. A tool's name, parameters, and enums are an interface other teams depend on. Breaking changes need a new version that runs beside the old one, consumer evals before cutover, and a deprecation window. Agents do pick up the new schema at runtime, but prompts, examples, and conversations in flight still assume the old one, and a description that names both parameters leaves the server rejecting one of them.

Production integration, reliability, and knowledge grounding

A knowledge assistant answers 18% of an evaluation set incorrectly. Trace analysis shows that in four of five failures the passage holding the answer is absent from the top 50 first-stage candidates, while the reranker and the generator perform well whenever the passage is present. Where should the team invest first?

- A stricter grounding instruction, telling the model to answer only from the provided passages and to refuse otherwise
- First-stage recall: chunking, embeddings, and query handling, since later stages cannot recover a passage never retrieved
- A stronger reranker, since reordering the candidates more accurately will lift the right passage into the final context
- A larger final context, passing ten reranked passages to the model instead of five so the answer is less likely to be cut

Check answer

### Show answer

Answer: First-stage recall: chunking, embeddings, and query handling, since later stages cannot recover a passage never retrieved. Diagnose retrieval by stage. If the passage never reaches the candidate set, reranking and prompting have nothing to work with, so the fix is upstream: how documents are chunked and embedded, whether lexical search is combined with vectors, and how queries are rewritten. A grounding instruction would turn these wrong answers into refusals, which is safer but does not make the assistant able to answer.

Advanced agent architecture and orchestration

A lead agent dispatches six research subagents in parallel, each with a one-line task such as 'research the supplier market'. The results overlap heavily, several subagents search the same sources, and two angles the lead cared about are missed entirely. What is the most effective change?

- Have the lead write each brief with an objective, scope boundaries, the expected output format, and guidance on sources
- Collapse the fan-out into a single subagent that works through all six angles in sequence inside one long context window
- Add a deduplication step after the fan-out that merges overlapping findings before the lead reads any of the results
- Send every subagent the lead's full conversation transcript, so that each one can infer what the others are probably covering

Check answer

### Show answer

Answer: Have the lead write each brief with an objective, scope boundaries, the expected output format, and guidance on sources. A subagent starts with a fresh context and sees only the brief it is handed, so a vague brief produces duplicated and misdirected work. Briefs that state the objective, boundaries against sibling tasks, and the output format are what make parallel dispatch pay off. Sharing the whole transcript spends context without dividing the work, and deduplicating afterwards pays for the overlap and still leaves the gaps.

Advanced agent architecture and orchestration

An operations agent runs on a managed agent platform with tools for reading dashboards, running diagnostics, and triggering production deployments. The team wants a person to approve every deployment before it runs, without adding prompts to the read-only tools. The platform offers per-tool permission policies, including one in which the server evaluates each call automatically. What configuration fits?

- Automatic approval on every tool, with a system prompt rule telling the agent to ask in chat before it deploys anything
- Automatic approval on every tool, with a daily review of session logs to catch any deployment that should not have run
- An always-ask policy on the deployment tool so the session pauses for confirmation, with lighter policies on read-only tools
- Automatic evaluation on every tool, since the server already denies calls it rates as high risk and pauses the uncertain ones

Check answer

### Show answer

Answer: An always-ask policy on the deployment tool so the session pauses for confirmation, with lighter policies on read-only tools. A requirement that a person reviews an action before it runs needs a policy that pauses the session until someone confirms. Automatic evaluation is useful for lowering prompt volume, but a call it judges safe runs before anyone sees it, so it is not a human checkpoint. A prompt rule is advisory, and log review finds a bad deployment after the fact.

Advanced agent architecture and orchestration

An agent built on the Claude Agent SDK runs in ephemeral containers. When a container is replaced mid-task, the service tries to resume by session id on the new container and fails, because the session transcript lives on the old container's local disk. Which fix addresses the cause?

- Pass the session id to the new container through an environment variable, so that the SDK can look the session up at startup
- Mirror session transcripts to shared storage through a session store, or carry the needed state into a new session as data
- Enable file checkpointing, so that the new container can rewind to the last snapshot and continue the conversation from there
- Raise the turn limit and the container's grace period, so that most tasks finish before the platform replaces the container

Check answer

### Show answer

Answer: Mirror session transcripts to shared storage through a session store, or carry the needed state into a new session as data. SDK sessions persist the conversation to files on the machine that ran them, so another host cannot resume unless the transcript is made available there, through a session store adapter or by restoring the file, or unless the application keeps its own state and starts fresh. File checkpointing tracks file changes rather than conversation history, and the session id is only a pointer to a transcript the new host does not have.

Advanced agent architecture and orchestration

An agent resolves billing tickets with an open-ended tool loop. Six months of production data show that 94% of tickets follow the same four steps, cost per ticket varies fivefold, and a required verification step is occasionally skipped. What should the team do?

- Add a second agent that reviews every finished ticket and reopens the ones where the verification step was missed
- Turn the common path into a fixed workflow with code-controlled steps, and route only unusual tickets to the agent loop
- Raise the reasoning effort for every ticket, so that the agent plans more carefully and stops skipping the verification
- Give the agent more specialized tools, so that each of the four common steps can be completed in a single tool call

Check answer

### Show answer

Answer: Turn the common path into a fixed workflow with code-controlled steps, and route only unusual tickets to the agent loop. When production data shows the path is predictable, a workflow gives lower and steadier cost and makes the verification step impossible to skip, while the agent loop is kept for the cases that need open-ended decisions. More effort or a reviewing agent adds cost to every ticket to manage variance that the design itself creates.

Advanced agent architecture and orchestration

A long-running research agent accumulates large tool results from file reads and searches, most of them stale within a few turns, and is approaching its context limit. It also needs key decisions to survive into later sessions. Which context policy fits?

- Summarize the whole conversation on the client after every turn, and replace the history with the new summary each time
- Clear old tool results with context editing, have the agent save durable facts to memory, and compact only near the limit
- Restart the session every fifty turns with only the system prompt, and let the agent rediscover whatever it still needs
- Move to the largest available context window and keep the full history, since any tool result might be needed again later

Check answer

### Show answer

Answer: Clear old tool results with context editing, have the agent save durable facts to memory, and compact only near the limit. The three mechanisms do different jobs: context editing prunes stale tool results within a session, memory carries facts across sessions, and compaction summarizes when the conversation itself nears the limit. Summarizing every turn rewrites the prefix constantly, which defeats prompt caching and loses detail early. A larger window only postpones the problem and makes every turn more expensive.

Observability and production monitoring

On-call engineers cannot tell whether slow agent tasks are caused by slow model calls, slow tools, or retries, because each task emits a single log line with its total duration. What instrumentation closes the gap?

- A latency histogram per task type with p50, p95, and p99, so that slow task types stand out on the service dashboard
- Debug-level logging of the full prompt and response for every model call, so that engineers can read back what happened
- One trace per task with a span per model request and tool call, carrying token usage, stop reason, retry count, and status
- A sampled capture of one task in a hundred with complete payloads, stored for a week for manual inspection if an incident occurs

Check answer

### Show answer

Answer: One trace per task with a span per model request and tool call, carrying token usage, stop reason, retry count, and status. An agent task is a tree of model requests and tool calls, and only spans at that granularity show where the time and tokens went and which step retried or failed. A per-task histogram says a task was slow but not why, and payload logging gives content without timing or structure and raises privacy and volume problems.

Observability and production monitoring

A healthcare team operates under a zero-data-retention arrangement with its model provider and wants traces good enough to debug agent failures. One engineer proposes exporting full prompts and responses to the observability backend, arguing that the retention arrangement already covers it. What is the right position?

- Export metadata-only spans by default, and capture content only into a store with redaction, access control, and retention rules
- Export a hash of each prompt and response instead of the text, so that traces stay complete while no readable content is stored
- Turn tracing off for this workload, since any span emitted by the service would break the terms of the retention arrangement
- Export full content on every span, since the provider's retention terms extend to any telemetry that is derived from the API traffic

Check answer

### Show answer

Answer: Export metadata-only spans by default, and capture content only into a store with redaction, access control, and retention rules. The provider's retention terms govern what the provider keeps, not what your telemetry backend stores: exported content sits under that backend's own access and retention settings. Metadata such as timing, token counts, status, and identifiers covers most debugging, and content capture should be a deliberate, governed exception. Hashes satisfy privacy but cannot be read during an investigation, and switching tracing off gives up debuggability that metadata would have provided safely.

Observability and production monitoring

A Claude-backed assistant meets its 99.9% HTTP availability objective, yet users report truncated answers, declined requests, and long waits before any text appears. Which service level indicators should the team add?

- Host-level saturation signals such as CPU, memory, and connection pool usage on every instance of the service that calls the model
- A count of 5xx responses from the model API, alerting whenever any appear within a five-minute evaluation window
- Share of requests ending in a usable completion, time to first token and total latency percentiles, and a sampled quality score
- A stricter availability objective of 99.99% on the same HTTP success measure, with a tighter error budget and paging

Check answer

### Show answer

Answer: Share of requests ending in a usable completion, time to first token and total latency percentiles, and a sampled quality score. An HTTP 200 can carry a truncated or declined response, so availability alone misses what users experience. Indicators should describe the outcome of the task: whether the response finished normally, how long the user waited for the first token and for the whole answer, and whether sampled outputs meet the quality bar. Host saturation and 5xx counts describe infrastructure health, which is already fine here.

Observability and production monitoring

A platform records two million agent traces a day and keeps a uniform 1% sample. A failure that affects 0.3% of requests for one tenant cannot be investigated, because almost none of the affected traces were kept. What sampling design fixes this?

- Keep only the traces that end in an error and discard the successful ones, since failures are the traces engineers read
- Tail-based sampling that keeps every trace with an error, refusal, truncation, or outlier cost, plus a uniform baseline
- Raise the uniform sample to 5%, so that five times as many of the affected traces are retained for the investigation
- Sample each tenant in proportion to its traffic, so that the largest tenants contribute the most retained traces

Check answer

### Show answer

Answer: Tail-based sampling that keeps every trace with an error, refusal, truncation, or outlier cost, plus a uniform baseline. Deciding after a trace completes lets the pipeline keep everything interesting, such as errors, refusals, truncated responses, and unusually slow or expensive tasks, while a uniform sample preserves a baseline to compare against. A larger uniform sample still drops most rare failures, and keeping only failures removes the healthy traces needed to see what differs. Metrics should still be computed over all traffic.

Evaluation engineering and quality assurance

A CI gate fails any pull request whose score drops more than one point on a 40-case suite that is run once per commit. Engineers find that rerunning an unchanged commit moves the score by up to four points, and they have started rerunning until the gate passes. What should change?

- Remove the cases whose results change between runs, so that the remaining suite gives the same score every time
- Allow up to three automatic reruns per commit, and pass the pull request as soon as any one of the runs clears the threshold
- Widen the allowed drop to five points, so that the gate only fails on changes larger than the variation seen so far
- Measure run-to-run variance, add cases and repeated trials, and gate on differences that clear the measured noise floor

Check answer

### Show answer

Answer: Measure run-to-run variance, add cases and repeated trials, and gate on differences that clear the measured noise floor. A gate cannot detect a one-point change when identical runs differ by four. The fix is to quantify the noise, shrink it with more cases and repeated trials, and compare with an interval rather than a single number. Widening the threshold without measuring hides real regressions, removing unstable cases deletes the behavior that most needs watching, and best-of-three reruns bias the gate toward passing.

Evaluation engineering and quality assurance

A regression suite has scored 99% for six months. A prompt change that users disliked in production passed it without a flag. What does this indicate, and what is the right response?

- The pass threshold is too lenient: raise it to 100% so that any single failing case blocks the release from going out
- The suite is saturated and has gaps: add harder cases and cases mined from production failures to the existing set
- The suite runs too rarely: schedule it hourly against production so that regressions surface sooner after each change
- The grader is too generous: replace it with a stricter rubric so that the same cases produce a wider spread of scores

Check answer

### Show answer

Answer: The suite is saturated and has gaps: add harder cases and cases mined from production failures to the existing set. A suite near its ceiling can no longer discriminate between versions, and passing it says little about behaviors it never covered. Saturated cases remain useful as a regression floor, but the suite needs harder items and fresh cases drawn from real failures. Raising the threshold or the run frequency does not add the missing coverage, and a stricter grader on the same cases mostly measures grader quirks.

Evaluation engineering and quality assurance

An LLM judge rates answers on a single 1 to 10 quality scale. A comparison with human labels shows weak agreement: the judge consistently scores longer answers higher, while the human raters prefer short, correct ones. What should the team do before using the judge to steer changes?

- Move to a 1 to 100 scale, so that the judge can express finer differences between answers of broadly similar quality
- Replace the holistic score with specific checkable criteria, tell the judge not to reward length, and re-measure agreement
- Ask the judge to explain its reasoning at length before scoring, so that each score arrives with a visible justification
- Average three judge runs per answer, so that the random variation in individual scores cancels out across the three separate runs

Check answer

### Show answer

Answer: Replace the holistic score with specific checkable criteria, tell the judge not to reward length, and re-measure agreement. A vague holistic scale invites the judge's own preferences, and judges reliably favor longer answers unless told otherwise. Concrete criteria scored separately, an explicit instruction about length, and validation against the human-labeled set are what make the judge trustworthy. Averaging runs reduces noise but not a systematic bias, and a finer scale gives the bias more room.

Evaluation engineering and quality assurance

A team ships a new prompt for an invoice extraction pipeline and wants to measure quality on live traffic. The only online signal today is a thumbs-up button that fewer than 1% of users press. Which measurement fits an extraction task?

- Text similarity between the new prompt's output and the previous prompt's output on the same set of live documents
- The average number of output tokens per extraction, tracked per prompt version as a proxy for how complete it is
- A judge model that rates each extraction for overall helpfulness on a five-point scale, with the ratings averaged per day
- Field-level accuracy on a sampled set of live documents verified by people, plus the rate of downstream corrections

Check answer

### Show answer

Answer: Field-level accuracy on a sampled set of live documents verified by people, plus the rate of downstream corrections. Extraction has a checkable right answer per field, so the metric should be field-level correctness on sampled live documents, backed by a behavioral signal such as how often people correct the result downstream. Sparse thumbs are too noisy, similarity to the old output rewards repeating the old mistakes, and helpfulness ratings fit open-ended generation rather than extraction.

Runtime guardrails and production security

A coding agent runs in CI with a shell tool. The project instructions file says never to run destructive commands against the production database, and last week the agent ran one anyway while chasing a failing migration. Which control actually prevents a repeat?

- A post-tool-use hook that inspects each command after it finishes and alerts the on-call engineer whenever one is destructive
- A second model call before each command that asks the agent to confirm the command is safe to run against production
- A firmer instruction in the project file, written in capitals and repeated at both the top and the bottom of the document
- A pre-tool-use hook and deny rules that block matching commands before they run, plus a sandbox with no route to production

Check answer

### Show answer

Answer: A pre-tool-use hook and deny rules that block matching commands before they run, plus a sandbox with no route to production. Instructions shape what the model tries to do but are not enforcement. A hook that runs before the tool call can block it deterministically, deny rules are applied by the harness rather than the model, and network isolation removes the target altogether. A post-tool-use hook fires after the damage is done, and a self-check is another model judgment that can fail the same way.

Runtime guardrails and production security

An assistant with persistent memory reads a web page during a research task. Hidden text on the page tells it to remember that all future reports should also be sent to an outside address. The assistant writes this to memory, and later sessions act on it. Which design change addresses the weakness?

- Instruct the assistant to save only statements that are true and relevant, and to ignore anything that looks suspicious
- Encrypt the memory store at rest and in transit, so that outside parties cannot read or alter what the assistant has saved
- Clear the memory store every night, so that any instruction planted during the day cannot influence the next day's sessions
- Treat memory written from untrusted content as untrusted, record its provenance, and keep action gates on the tools themselves

Check answer

### Show answer

Answer: Treat memory written from untrusted content as untrusted, record its provenance, and keep action gates on the tools themselves. Memory poisoning turns a one-time injection into a persistent one. The defenses are to control what untrusted content can cause to be written, to keep provenance so memory is read as data rather than instructions, and to enforce approvals and allowlists at the tool layer so no remembered text can authorize an action. Encryption protects the store from outsiders but the assistant itself wrote the entry, and nightly clearing removes the feature while leaving a full day of exposure.

Runtime guardrails and production security

CI pipelines and cluster services across a company call the Claude API with one long-lived API key copied into dozens of secret stores. The key has just appeared in a build log. Beyond revoking it, which change removes this class of incident?

- Issue a separate long-lived key to each team, and rotate all of them on a monthly schedule through the secrets manager
- Workload identity federation: each workload trades its platform identity token for a short-lived token tied to a service account
- Restrict the shared key to the company's network ranges, so that a leaked copy cannot be used from anywhere else
- Move the shared key into a single central secret store, and have every pipeline fetch it at the start of each job

Check answer

### Show answer

Answer: Workload identity federation: each workload trades its platform identity token for a short-lived token tied to a service account. Federation removes the static secret: a workload proves who it is with a token from an identity provider the organization already trusts and receives a short-lived credential scoped by a federation rule, so there is nothing long-lived to copy or leak. Per-team keys, rotation, and network restrictions reduce the blast radius of a leak but keep long-lived secrets in circulation.

Advanced debugging and incident response

An order-support agent intermittently tells customers that no orders were found. Traces show the lookup tool span returning the full result each time, while the next model request contains a result cut off after a fixed number of characters with no marker. Failures occur only for customers with long order histories. Where is the fault, and what is the fix?

- The tool: it returns too much data, so cap the lookup at the ten most recent orders and drop the rest of the history
- The model: it loses track of long tool results, so move to a larger model with a longer effective attention span
- The harness: it truncates silently, so page or filter results in the tool and tell the model when output was cut
- The prompt: it lacks emphasis, so add an instruction to read every tool result in full before answering the customer

Check answer

### Show answer

Answer: The harness: it truncates silently, so page or filter results in the tool and tell the model when output was cut. Comparing the tool span with the next model request isolates the layer: the tool produced the data and the model never received it. Silent truncation in the harness makes a data-delivery bug look like a model failure. The fix is to control result size deliberately, with pagination or filters, and to signal truncation so the model can ask for more. A bigger model or a firmer prompt cannot read text that was removed.

Advanced debugging and incident response

An agent fails on a particular input roughly once in thirty runs. An engineer reruns it once, sees a correct result, and proposes closing the ticket. What is the sound way to debug this?

- Capture the exact failing request, replay it many times to measure the failure rate, and test the fix against it
- Wrap the step in an automatic retry, so that the occasional failure is absorbed and never reaches the user again
- Close the ticket as transient, and reopen it only if the same customer reports the same failure for a second time
- Rerun the whole task end to end five times, and treat five clean runs as evidence that the problem has gone away by itself

Check answer

### Show answer

Answer: Capture the exact failing request, replay it many times to measure the failure rate, and test the fix against it. A failure with a low base rate cannot be confirmed or cleared by a few reruns: five clean runs are expected most of the time at one in thirty. Debugging needs the exact request that failed, including messages, tools, parameters, and model version, a replay that estimates the rate, and a fix judged by a measurable drop. A blind retry hides the defect and doubles its cost when the failure is correlated with the input.

Advanced debugging and incident response

At 14:00 a team deploys a new prompt version together with an updated tool definition. By 14:30 monitoring shows the wrong-answer rate on sampled traffic has tripled. What should the on-call engineer do first?

- Investigate in production until the root cause is understood, so that the eventual fix addresses the real problem
- Roll back to the last known-good prompt and tool versions, confirm recovery on the same metric, then investigate from traces
- Wait for another hour of traffic, so that the sample is large enough to be sure the change in rate is not noise
- Edit the live prompt to patch the most common wrong answer, and watch whether the wrong-answer rate comes back down

Check answer

### Show answer

Answer: Roll back to the last known-good prompt and tool versions, confirm recovery on the same metric, then investigate from traces. During a regression the first job is to stop the harm, and a rollback to a known-good version is the fastest safe mitigation when a deploy is the obvious suspect. Root cause analysis follows from preserved traces once users are protected. Debugging forward or hot-patching a live prompt extends the incident and adds an untested change on top of it.

Agent fleet operations for software delivery

Six coding agents work in parallel on separate tasks in one checkout of a repository. They overwrite each other's edits, and test runs fail unpredictably because the working tree keeps changing underneath them. What is the standard fix?

- A file-level lock service that each agent must acquire before editing, releasing the lock once its own tests have passed
- A separate git worktree and branch per agent, each with its own build and test state, integrated through pull requests
- A rule that every agent commits to the shared branch after each edit, so that the others always see the latest state
- A queue that runs the six agents one after another in the shared checkout, each starting when the previous one ends

Check answer

### Show answer

Answer: A separate git worktree and branch per agent, each with its own build and test state, integrated through pull requests. Worktrees give each agent its own files and branch while sharing repository history, so parallel edits and test runs cannot collide, and integration happens through normal review. Locks and constant commits to one branch keep the agents coupled through a single working tree, and running them in sequence gives up the parallelism the fleet exists for.

Agent fleet operations for software delivery

An engineering organization wants an AI code reviewer to block merges starting next week. No one has measured how its findings compare with those of human reviewers. What rollout is appropriate?

- Enable blocking for every finding from the first day, and let developers appeal individual findings to a maintainer
- Run it in shadow mode, compare its findings with human review outcomes, then gate only on categories with proven precision
- Enable blocking only on pull requests written by agents, since those are the changes that people review least closely
- Keep the reviewer advisory indefinitely, and let each team decide informally how much weight to give its comments

Check answer

### Show answer

Answer: Run it in shadow mode, compare its findings with human review outcomes, then gate only on categories with proven precision. A merge gate with unknown precision either blocks good changes or teaches developers to ignore it. Shadow mode produces the comparison data: which finding types humans agree with, what it misses, and how noisy it is. Gating authority is then granted category by category. Advisory forever without measurement never earns or loses trust, and limiting the gate to agent-written changes still gates on unmeasured findings.

Agent fleet operations for software delivery

A security team needs a guarantee that no developer's coding agent can read environment secret files or run with permission checks bypassed, whatever is configured in a repository or in a developer's own settings. Which mechanism provides that guarantee?

- Deny rules committed to each repository's shared project settings file, and reviewed whenever a change touches that file
- A standing instruction in each repository's project instructions file that tells the agent never to read secret files
- A written acceptable-use policy, with a quarterly audit of a sample of developers' local configuration files
- Managed settings from the organization, with deny rules and bypass mode disabled, which outrank user and project files

Check answer

### Show answer

Answer: Managed settings from the organization, with deny rules and bypass mode disabled, which outrank user and project files. Managed settings sit at the top of the settings precedence, so user, project, and command-line values cannot override them, and deny rules are evaluated before allow rules. Project settings cover only the repositories that carry the file and can be changed by the people they are meant to constrain. Instructions influence the model but are not enforced by the harness, and an audit detects drift after the fact.

Cost and latency optimization at scale

To cut spend, a team routes every support request to the smallest model. Per-request cost falls, but retries and escalations to people rise, and cost per resolved ticket ends up higher than before. How should the routing decision be made?

- By per-token price alone, keeping the smallest model for everything and adding two more automatic retries before any escalation
- By prompt length alone, sending short requests to the smallest model and long requests to the largest model in the family
- By cost per completed task: route by task class, escalate on a checkable failure signal, and test larger models at lower effort
- By moving every request back to the largest model, on the view that quality problems always cost more than the tokens saved

Check answer

### Show answer

Answer: By cost per completed task: route by task class, escalate on a checkable failure signal, and test larger models at lower effort. Per-token price does not predict the cost of getting the job done: a cheap request that needs retries or a human costs more than a more expensive one that finishes. Routing should be judged on cost per completed task from evals and production data, with escalation triggered by a signal that can be checked, and a larger model at lower effort is a candidate worth measuring. Prompt length is a weak proxy for difficulty.

Cost and latency optimization at scale

A chat product must show the first visible text within two seconds. Median total response time is fourteen seconds, every request re-sends an uncached 25,000-token system prompt, the response is delivered only when complete, and the model reasons before answering even on routine turns. Which changes address the target?

- Stream the response, cache the stable prefix to cut time to first token, and lower effort on routine turns
- Run the turn's tool calls in parallel, so that time spent between model calls no longer delays the reply
- Halve max_tokens on every request, so that the model finishes sooner and the complete response arrives earlier
- Move the requests to the Message Batches API, where higher throughput shortens the wait for each response

Check answer

### Show answer

Answer: Stream the response, cache the stable prefix to cut time to first token, and lower effort on routine turns. The target is about the first visible output, not total time. Streaming shows text as it is produced, caching removes the cost of re-reading a long prefix before generation starts, and lower effort shortens the reasoning that precedes the first visible token. max_tokens is a cap the model does not see, batches trade latency for cost, and no tool calls are described in this turn.

Production integration, reliability, and knowledge grounding

A service on the Claude API uses a server-side tool and a beta feature. To improve resilience the team adds a failover route to a cloud platform's Claude endpoint and replays failed requests there unchanged. In a game-day test the failover requests are rejected with 400 errors. What is the right design?

- Retry the rejected requests on the secondary platform with exponential backoff until the platform accepts them
- Strip every header and field the secondary platform rejects at the gateway, without telling the calling application
- Keep a capability matrix per platform, build the fallback request for that platform, and degrade features it lacks
- Pin both routes to the oldest API version that either platform supports, so that both accept the same request shape

Check answer

### Show answer

Answer: Keep a capability matrix per platform, build the fallback request for that platform, and degrade features it lacks. Feature availability differs between the first-party API and cloud platforms, so a request that is valid on one can be invalid on another, and a 400 will never succeed on retry. A fallback has to be built for the target: use what it supports, replace or drop what it does not, and exercise the path regularly in tests. Silent stripping changes behavior without the application knowing, such as answering without the tool.

Production integration, reliability, and knowledge grounding

In an agent loop, some responses stop with stop_reason max_tokens while the last content block is a tool_use whose input is cut off mid-JSON. The harness tries to parse and execute the block, and tools receive malformed or partial arguments. What should the harness do?

- Append a user message asking the model to continue, so that it completes the JSON in its next response
- Lower the output limit further, so that the model learns to keep its tool arguments short enough to fit
- Check stop_reason before running tools, and on a truncated tool_use re-issue the request with a higher max_tokens
- Repair the truncated JSON with a tolerant parser and run the tool with whichever arguments could be recovered from it

Check answer

### Show answer

Answer: Check stop_reason before running tools, and on a truncated tool_use re-issue the request with a higher max_tokens. A response cut off by the output limit is incomplete, and a partial tool call must never be executed. The documented handling is to retry the request with a larger max_tokens so the full call is produced. Repairing JSON risks running a tool with wrong arguments, and a tool_use block left without a matching tool_result makes the follow-up request invalid rather than continuing it.

Production integration, reliability, and knowledge grounding

A SaaS product serves two hundred tenants through one Claude organization. One tenant starts a bulk import that consumes nearly all of the output-token capacity, and interactive users at other tenants see rate-limit errors. Which design isolates tenants?

- Per-tenant token budgets and fair queueing in your own gateway, with separate interactive and bulk lanes
- A larger max_tokens for interactive requests, so that they reserve output capacity ahead of the bulk import
- A higher retry count for interactive requests, so that they eventually succeed once the bulk import has finished
- A dedicated API key per tenant inside the same workspace, so that each tenant's traffic is counted against its own key

Check answer

### Show answer

Answer: Per-tenant token budgets and fair queueing in your own gateway, with separate interactive and bulk lanes. Rate limits apply to the organization, with optional lower limits per workspace, not per key, so tenant fairness has to be enforced by the application: meter each tenant, queue fairly, and keep bulk work in a lane that cannot starve interactive traffic. A workspace limit on the bulk lane is a useful backstop. Retries add load at the worst moment, and max_tokens does not reserve rate-limit capacity.

Production integration, reliability, and knowledge grounding

A team submits a batch of 90,000 requests generated by new code. A day later every result comes back as errored with an invalid-request message: the tool schema in each request was malformed. How should the pipeline prevent a repeat?

- Poll the batch status every minute, so that the invalid requests are noticed as soon as processing begins
- Split the work into nine smaller batches, so that a malformed request can only affect the batch that contains it
- Add automatic resubmission of every errored request, so that the failed requests are retried without intervention
- Validate the request shape with a synchronous Messages call or a small canary batch before the full submission

Check answer

### Show answer

Answer: Validate the request shape with a synchronous Messages call or a small canary batch before the full submission. Batch request parameters are validated asynchronously, and validation errors are reported only when the batch has finished processing, so a systematic mistake costs a full cycle. Sending one representative request through the synchronous API, or a small canary batch, catches it in seconds. Smaller batches all carry the same defect, status polling at best reveals the failure after submission, and resubmitting invalid requests fails again.

Production integration, reliability, and knowledge grounding

A provider announces a new model. Its release notes list request parameters the new model rejects and a changed default for reasoning effort. A team's service has dozens of request shapes across four features. What is the responsible migration plan?

- Mirror production traffic to the new model for a quarter, and migrate once no errors have appeared in the mirror
- Switch the model identifier in production on release day, since the Messages API is stable across model versions
- Run every request shape and the eval suite on the new model in staging, re-tune effort and prompts, then canary
- Keep the existing prompts and settings, switch all traffic, and compare token usage between the old and new model

Check answer

### Show answer

Answer: Run every request shape and the eval suite on the new model in staging, re-tune effort and prompts, then canary. A model change can break requests outright and can shift behavior without any error. Exercising each request shape finds rejected parameters, the eval suite finds behavior changes, and effort and prompts tuned for the old model usually need another pass. A canary with the previous version pinned for rollback keeps the blast radius small. Token usage says nothing about quality, and an error-free mirror with no quality comparison only proves the requests are accepted.

Production integration, reliability, and knowledge grounding

A new prompt version has passed offline evals. The service has forty tenants and no way today to tell which prompt version produced a given response. How should the version be released?

- To half of all traffic immediately, so that the comparison reaches statistical significance as fast as possible
- To a small traffic slice with the version id on every trace, guard metrics against control, and automatic rollback
- To all tenants at once during the quietest hour of the week, with the team watching the dashboards for the first hour
- To internal users only for a month, promoting it if no one on the team reports a problem during that time

Check answer

### Show answer

Answer: To a small traffic slice with the version id on every trace, guard metrics against control, and automatic rollback. Offline evals reduce risk but do not cover the full input distribution, so exposure should start small and grow as guard metrics hold. Tagging each trace with the prompt version is what makes comparison and rollback possible at all. A full release has no control group, internal users are not representative, and a half-and-half split exposes half of production to a regression the canary would have caught at one percent.

Production integration, reliability, and knowledge grounding

A support assistant retrieves from product documentation using embeddings only. It fails on questions that contain exact part numbers and error codes: the retrieved passages are about similar products or neighboring codes. Which retrieval change targets this failure?

- An embedding model with more dimensions, so that near-identical part numbers end up further apart in the vector space
- A larger candidate set from the vector index, raising the number of nearest neighbors retrieved from twenty to two hundred
- Hybrid search that combines lexical matching with embeddings and fuses the rankings, with a reranker on the merged set
- Smaller chunks of about one sentence each, so that every embedding represents a single precise statement from the documentation

Check answer

### Show answer

Answer: Hybrid search that combines lexical matching with embeddings and fuses the rankings, with a reranker on the merged set. Embeddings capture meaning and blur exact tokens, so identifiers such as part numbers and error codes are where lexical search does better. Combining both and reranking the merged set keeps semantic recall while restoring exact-match precision. Smaller chunks and bigger embeddings do not make an identifier match exactly, and more neighbors mostly adds more near-misses.

Advanced agent architecture and orchestration

An orchestrator fans a market analysis out to eight workers. Two workers hit rate limits and return an empty or partial result. The orchestrator writes a confident final report as though all eight sections were complete. What design change fixes this?

- Add a closing step in which the orchestrator asks itself whether the report is complete before it is sent
- Run every worker twice and keep the longer of the two results, so that a failed run is always covered by its duplicate
- Raise each worker's turn limit and timeout, so that workers have more room to recover from transient errors
- Have each worker return a structured status with what is missing, and have the orchestrator retry or report gaps

Check answer

### Show answer

Answer: Have each worker return a structured status with what is missing, and have the orchestrator retry or report gaps. Failures must cross the agent boundary as explicit data. A worker result that states complete, partial, or failed, with what is missing, lets the orchestrator retry, reassign, or disclose the gap, and orchestration code can enforce that check. Asking the orchestrator to self-assess relies on it noticing an absence it has no signal for, and running everything twice doubles cost while both runs can fail the same way.

Advanced agent architecture and orchestration

Three specialist subagents produce a data extract, a code patch, and a written analysis. Each returns its full output to the orchestrator, which re-types all three into its final answer. The final answer contains transcription errors, and the orchestrator's context is nearly full. What design change fixes this?

- Have subagents write outputs to a shared store and return a short summary with a reference, so results are not re-typed
- Have each subagent send its output twice, so that the orchestrator can compare the two copies and catch its own copying errors
- Tell the subagents to keep their outputs short, so that the orchestrator has less material to carry into its answer
- Raise the orchestrator's output limit and context budget, so that it can hold and repeat all three outputs in full

Check answer

### Show answer

Answer: Have subagents write outputs to a shared store and return a short summary with a reference, so results are not re-typed. Passing large artifacts through a coordinator turns it into a lossy relay: every copy costs context and risks alteration. Letting subagents persist their work, such as files or records, and hand back a lightweight reference with a summary keeps fidelity and keeps the orchestrator's context for coordination. A bigger budget only delays the overflow, duplicate copies double the load, and forcing short outputs discards the detail the task needed.

Advanced agent architecture and orchestration

A long-running agent posts 500 invoices to a ledger. The process crashes at invoice 312, and the restart runs the task from the beginning, posting the first 311 invoices a second time. Which design makes the run safely resumable?

- Checkpoint progress durably after each invoice and give each posting an idempotency key, so replays are harmless
- Wrap the whole run in one database transaction, so that a crash rolls back every posting and the run starts clean
- Resume the saved conversation transcript after a crash, since it shows the agent which invoices it already posted
- Run a reconciliation job each night that finds duplicated postings in the ledger and reverses them automatically

Check answer

### Show answer

Answer: Checkpoint progress durably after each invoice and give each posting an idempotency key, so replays are harmless. Resumability needs two things: durable progress outside the process, so the run continues at invoice 312, and idempotent side effects, so a repeated call cannot post twice. A transaction spanning hours and an external ledger is not practical. The transcript restores context but does not stop a replayed tool call from executing, and reconciliation repairs duplicates after they have already reached the books.

Advanced agent architecture and orchestration

A seven-step document pipeline with fixed prompts fails on about 30% of inputs, which need a different number of lookups than the pipeline assumes. The team has added branching rules for a year, and each new rule breaks an older one. What is the right next step?

- Add the next set of branching rules and a test for each one, since the pipeline is close to covering every case
- Move the variable part into an agent loop with tools and limits, keep the fixed steps around it, and gate on evals
- Run a larger model in each of the seven steps, so that each step copes better with inputs the rules did not expect
- Send failed inputs through the same pipeline a second time, and escalate to a person if the second pass also fails

Check answer

### Show answer

Answer: Move the variable part into an agent loop with tools and limits, keep the fixed steps around it, and gate on evals. When the number and order of steps depends on the input, hard-coded branching becomes the maintenance burden the data shows. An agent loop handles the variable part, deterministic steps stay deterministic, and evals plus cost and turn limits control the added variance. A larger model inside a fixed sequence still performs the wrong number of lookups, and retrying the same pipeline repeats the same mismatch.

Advanced agent architecture and orchestration

A support agent holds long conversations whose history is served from the prompt cache. Mid-conversation, an operator sometimes needs to switch the agent into an escalation mode. The team implements this by editing the top-level system prompt, and every switch causes the full history to be reprocessed uncached. What is the better approach?

- Use the one-hour cache lifetime instead of the five-minute default, so that the cached history survives the edit
- Add a cache breakpoint immediately after the edited sentence, so that the text following it stays in the cache
- Shorten the system prompt to a few lines, so that an edit to it invalidates fewer tokens when the mode changes
- Keep the system prompt byte-identical and append the instruction after the cached history as a new message

Check answer

### Show answer

Answer: Keep the system prompt byte-identical and append the instruction after the cached history as a new message. Caching is a prefix match and the system prompt sits ahead of the whole conversation, so editing it invalidates every cached turn. An instruction appended after the history leaves the prefix intact: on models that support it, a system-role message inside the messages array, otherwise text in the newest user turn. Breakpoints and lifetimes do not rescue a prefix whose earlier bytes changed.

Observability and production monitoring

A cost dashboard multiplies each response's input_tokens by the input price. After prompt caching is enabled, the dashboard shows input cost falling by 70% while the invoice barely moves. What is wrong with the dashboard?

- It ignores cache writes and cache reads, which are reported in separate usage fields and billed at their own rates
- It reads usage from responses, while the invoice is computed from requests, so the two can never be reconciled
- It counts tokens once per response, while the invoice counts each retry of a request as its own separate billable call
- It uses live data, while the invoice lags by a billing cycle and will show the same fall in the following month

Check answer

### Show answer

Answer: It ignores cache writes and cache reads, which are reported in separate usage fields and billed at their own rates. With caching, input_tokens covers only the uncached tokens after the last breakpoint. Tokens written to the cache and tokens read from it are reported separately and priced differently, so total input is the sum of all three fields. A dashboard that prices only one field understates spend as soon as caching is on. Retries and invoice timing exist but do not explain a gap that appeared with caching.

Observability and production monitoring

A service calls a model through an alias. The alias moves to a newer snapshot, nothing errors, and a week later support tickets about answer quality are up 40%. Which monitoring would have surfaced the change within hours?

- The served model id logged on every response, plus a scheduled canary eval and sampled online grading
- An alert on p99 latency and error rate for the model API, evaluated over five-minute and one-hour windows
- A monthly review of thumbs-down counts per feature, compared with the same month of the previous year
- A subscription to the provider's release notes, with a rotation for reading them whenever a new entry is published

Check answer

### Show answer

Answer: The served model id logged on every response, plus a scheduled canary eval and sampled online grading. Behavioral drift produces no errors, so it has to be measured directly: record which model actually served each request, run a fixed canary set on a schedule, and grade a sample of live outputs, alerting on a shift from baseline and slicing by model version. Latency and error alerts stay green through a quality change, and monthly feedback reviews are far too slow. Pinning an explicit version would also make the change deliberate.

Observability and production monitoring

Task success for an agent fell from 93% to 90% over two weeks. An engineer reads twenty randomly chosen failed traces and finds no common thread. What is the most productive next step?

- Compare failure rates by cohort, such as tool, prompt version, model version, tenant, and input type, against baseline
- Read two hundred more failed traces in full, since a common pattern should emerge once enough examples have been examined
- Ask a model to summarize the twenty traces and propose the most likely single cause of the failures it sees
- Roll back every change deployed in the two-week window, and redeploy them one at a time until the rate drops

Check answer

### Show answer

Answer: Compare failure rates by cohort, such as tool, prompt version, model version, tenant, and input type, against baseline. A three-point shift is usually concentrated somewhere, and individual traces rarely show it because each failure looks ordinary. Aggregating by dimension and comparing with the baseline period reveals which cohort moved, and only then is reading traces from that cohort efficient. Reading more random traces scales poorly, a mass rollback is disruptive without evidence, and a summary of twenty traces inherits their lack of signal.

Evaluation engineering and quality assurance

A prompt engineer tunes a prompt against the golden set for several weeks, copying hard cases from it into the prompt as few-shot examples. The golden-set score reaches 97%, while accuracy on a fresh sample of production traffic is 80%. What should the evaluation process change?

- Expand the golden set with paraphrased variants of the existing cases, so that the score rests on more examples
- Swap the grader for a different judge model, so that the score is no longer tied to one judge's preferences
- Hold out a test split never used for tuning or few-shot examples, refresh it from production, and report that score
- Require the tuned prompt to reach 99% on the golden set before release, to leave a margin for production traffic

Check answer

### Show answer

Answer: Hold out a test split never used for tuning or few-shot examples, refresh it from production, and report that score. Once golden cases are used to tune the prompt, and especially once they appear inside it, the score measures memorization of those cases. A held-out split that the prompt never sees, refreshed from real traffic, is what estimates production accuracy. Paraphrases of contaminated cases stay contaminated, and a higher bar on the same set rewards more overfitting.

Evaluation engineering and quality assurance

An eval for a coding agent passes a case only if the agent's tool calls match a recorded sequence exactly. After a model upgrade, pass rate drops by 30 points, yet manual inspection shows the new model solves the tasks through different, valid routes. How should the eval be redesigned?

- Accept any run whose tool sequence is at least 80% similar to the recorded one, to allow for small variations in the order of calls
- Have a judge model read each transcript and decide whether the sequence of steps looks like a reasonable approach
- Re-record the expected tool sequences with the new model, and repeat the recording after every future model upgrade
- Grade the end state, such as tests passing and no off-limits files touched, and keep path checks only for safety invariants

Check answer

### Show answer

Answer: Grade the end state, such as tests passing and no off-limits files touched, and keep path checks only for safety invariants. An agent eval should reward reaching the right outcome, not following one particular route. Checking what the run left behind in a clean environment is robust to model changes, with trajectory checks reserved for things that must never happen. Re-recording sequences bakes in each model's habits, similarity thresholds still penalize valid alternatives, and a judge reading a transcript grades the narration rather than the result.

Evaluation engineering and quality assurance

An eval uses an LLM judge referenced by a model alias. The alias moves to a newer model, and the pass rate of the unchanged production system rises five points overnight. How should the team treat this?

- As run-to-run noise, rerunning the eval three times and reporting the average of the three resulting pass rates
- As a real improvement in the production system, since a newer judge is more accurate than the one it replaced
- As judge drift: pin the judge model and prompt, re-calibrate on the human-labeled set, and re-baseline first
- As a reason to lower the release threshold by five points, so that earlier and later results stay comparable

Check answer

### Show answer

Answer: As judge drift: pin the judge model and prompt, re-calibrate on the human-labeled set, and re-baseline first. The system under test did not change, so the instrument did. A judge is part of the measurement and must be versioned like one: pinned model, pinned prompt, and agreement with human labels re-measured whenever either changes. Scores from different judge versions are not comparable until a baseline is re-established. Moving the threshold by the size of the jump assumes the shift is uniform across cases, which nothing has shown.

Evaluation engineering and quality assurance

To evaluate a new prompt online, a team switches all traffic to it on a Monday and compares the week's resolution rate with the previous week's. The rate is two points higher. Why is this weak evidence, and what is the sound design?

- The periods differ in more than the prompt: randomize users across both versions concurrently, with preset metrics
- One week is too short: run the new prompt for a full month and compare it with the same calendar month of the previous year
- A two-point lift is too small: require at least a five-point lift in a before-and-after comparison before adopting it
- Resolution rate is too coarse: compare the average length and token count of responses across the two weeks instead

Check answer

### Show answer

Answer: The periods differ in more than the prompt: randomize users across both versions concurrently, with preset metrics. A before-and-after comparison confounds the prompt with everything else that changed between the weeks, including traffic mix, incidents, and seasonality. Concurrent random assignment isolates the prompt, and fixing the primary metric, guardrail metrics, and sample size in advance prevents stopping when the result looks good. Longer or stricter before-and-after comparisons keep the same confound.

Runtime guardrails and production security

A research agent needs to run code and browse documentation sites. It currently runs on a virtual machine next to production, with service credentials in its environment. Which setup grants the access it needs without exposing production?

- The same machine, with the service credentials swapped for read-only ones that cannot modify any production data
- The same machine, with the agent running as an unprivileged user and a blocklist of dangerous shell commands in place
- A separate machine inside the production network, with the agent's shell history shipped to the security team daily
- An isolated sandbox with scoped filesystem access, an egress allowlist through a proxy, and credentials kept outside it

Check answer

### Show answer

Answer: An isolated sandbox with scoped filesystem access, an egress allowlist through a proxy, and credentials kept outside it. Isolation should be enforced by the environment, not by the agent's judgment: a sandbox limits what code can touch, an egress allowlist limits where data can go, and keeping credentials outside the sandbox means injected content cannot read them. An unprivileged user and a command blocklist are easy to sidestep, and read-only credentials can still be used to read and exfiltrate data.

Runtime guardrails and production security

An output filter blocks any response containing a digit string that could be an account number. It blocks 9% of legitimate responses, mostly order numbers, while an audit finds that responses combining a name with a date of birth pass through. How should the team tune it?

- Measure precision and recall per category on a labeled set, choose an action per category, and track both error types
- Replace the filter with a system prompt instruction that tells the model never to include personal data in a response
- Tighten the filter to block any response that contains a name, a date, or a number, in order to stay firmly on the safe side
- Loosen the digit pattern step by step until complaints about blocked responses stop arriving from the support team

Check answer

### Show answer

Answer: Measure precision and recall per category on a labeled set, choose an action per category, and track both error types. A guardrail has two error rates, and tuning one by complaint volume ignores the other. A labeled set makes false positives and false negatives measurable per data category, and different categories deserve different actions: redaction for an identifier, blocking for a sensitive combination. A prompt instruction is not a control, and blocking everything that resembles data makes the product unusable while still missing what the pattern does not describe.

Runtime guardrails and production security

Before launching an agent that reads documents and web pages and can call internal tools, a team plans a red-team exercise consisting of twenty jailbreak prompts typed into the chat box. What would make the exercise meaningful?

- Repeat the twenty prompts against a more capable model, to see whether a stronger model resists them any better
- Use two hundred jailbreak prompts from public collections, so that the exercise covers more of the known attack phrasings
- Map each untrusted input channel against each sensitive tool, plant indirect injections there, and score harmful actions
- Measure how often the agent refuses clearly harmful questions, and require a refusal rate above a set threshold

Check answer

### Show answer

Answer: Map each untrusted input channel against each sensitive tool, plant indirect injections there, and score harmful actions. The attack surface of a tool-using agent is the content it reads, not only what a user types. A useful exercise starts from a threat model, places injections in documents, pages, and tool results, and judges success by whether an unsafe action or data flow occurred. Successful attacks then become regression tests. Direct jailbreak prompts and refusal rates measure chat safety and miss the indirect paths.

Runtime guardrails and production security

Every agent in a company acts on downstream systems through one shared service account that holds administrator rights. After an unauthorized configuration change, nobody can tell which agent, session, or user was behind it. What should change?

- Keep the shared account, and require each agent to write its name into the free-text comment field of every change
- Split the shared account into one for reads and one for writes, and review the write account's activity each week
- Keep the shared account, and store every agent's full prompts and responses so that changes can be traced by reading them
- Give each agent its own identity with only the permissions its task needs, and audit-log every sensitive call it makes

Check answer

### Show answer

Answer: Give each agent its own identity with only the permissions its task needs, and audit-log every sensitive call it makes. Attribution and least privilege both start with identity: an agent that authenticates as itself, with scoped permissions, can be audited and can do limited damage. Security-relevant calls should be logged with the initiating user, session, inputs, and result. A shared administrator account is the excessive agency risk named in the OWASP Top 10 for LLM Applications, and self-reported comments or stored prompts are not an audit trail.

Advanced debugging and incident response

A multi-agent system produces a report with a wrong revenue figure. Three subagents contributed, and the orchestrator wrote the final text. What is the most direct way to find where the error entered?

- Rerun the whole system on the same input, and check whether the wrong figure appears again in the new report
- Raise the effort setting on all four agents, and compare the new report with the original one for differences
- Follow the figure back through each handoff, comparing what each subagent returned with what the orchestrator kept
- Add a verifier agent at the end of the pipeline that checks every figure in the final report against the sources

Check answer

### Show answer

Answer: Follow the figure back through each handoff, comparing what each subagent returned with what the orchestrator kept. In a multi-agent trace the question is where a value first became wrong: in a tool result, in a subagent's summary, or in the orchestrator's synthesis. Walking the handoffs backwards finds the first divergence and identifies the layer to fix. A rerun may not reproduce a non-deterministic failure and says nothing about its origin, and a verifier may catch the symptom next time without explaining this one.

Advanced debugging and incident response

After a model upgrade, about 2% of requests to an internal security-scanning assistant return no usable output. The dashboard shows a 100% success rate, because every response is an HTTP 200. Inspection shows these responses end with a refusal stop reason. What should the team do?

- Treat the responses as transient failures, and retry each one on the same model until it eventually returns usable output
- Record refusals as a distinct outcome in telemetry and evals, sliced by request type, with a designed handling path
- Raise max_tokens for the affected requests, since an empty output usually means the response ran out of room
- Keep counting them as successes, since the API accepted and processed each request without returning an error

Check answer

### Show answer

Answer: Record refusals as a distinct outcome in telemetry and evals, sliced by request type, with a designed handling path. A refusal is a successful HTTP response with a distinct stop reason, so status-code metrics cannot see it. It needs its own category in telemetry and evals, broken down by request type to show which legitimate work is affected, and a deliberate path such as a prompt revision, a fallback, or a clear message. Retrying the identical request on the same model repeats the decision, and truncation would show a different stop reason.

Advanced debugging and incident response

An agent emailed the wrong customers because two accounts shared a name and its lookup tool returned the first match. The draft postmortem lists one action item: remind the team to be more careful with customer lookups. What should the postmortem produce instead?

- A sentence added to the system prompt telling the agent to double-check the recipient before sending any email
- A rewritten incident summary that names the engineer who shipped the lookup tool and the reviewer who approved it
- Regression cases for ambiguous matches, an alert on the signal that would have caught it, and a fix to the lookup
- A month of manual review of every outgoing email, after which the review ends if no further errors are found

Check answer

### Show answer

Answer: Regression cases for ambiguous matches, an alert on the signal that would have caught it, and a fix to the lookup. A postmortem should leave the system harder to break in the same way: the failing scenario and its variants become eval cases that gate releases, monitoring gains the signal that was missing, and the control gap is closed, here by making the tool return ambiguity instead of a first match. Reminders and prompt sentences decay, temporary manual review ends, and blame teaches people to hide problems.

Agent fleet operations for software delivery

A 400-file migration is fanned out to twenty coding agents, split by product feature. Nearly every agent edits the same shared configuration and type definition files, and integration stalls on conflicts. How should the work be restructured?

- Land the shared-file changes first as one prerequisite, then split by file ownership into small independent pull requests
- Double the number of agents, so that each one touches fewer files and conflicts between any two become less likely
- Let all twenty agents finish, then combine everything into one large pull request and resolve the conflicts in a single pass
- Assign a dedicated merge agent to resolve every conflict between the twenty branches as soon as each one appears

Check answer

### Show answer

Answer: Land the shared-file changes first as one prerequisite, then split by file ownership into small independent pull requests. Parallel work only merges cleanly when tasks do not write the same files. Changing shared interfaces once, up front, and then decomposing along ownership boundaries gives small changes that can be verified and merged on their own. One giant pull request is unreviewable, a merge agent treats the symptom of a bad split, and more agents on the same decomposition multiply the collisions.

Agent fleet operations for software delivery

Coding agents now open three hundred pull requests a day for a team with twelve reviewers. Reviews have become rubber stamps, and two defective changes reached production last month. How should verification be redesigned?

- Agents approve each other's pull requests, with people looking only at the changes that the agents disagree about
- A daily cap on reviews per person, with any pull request still unreviewed at the end of the day merged automatically
- Two human approvals on every pull request, so that a second reviewer catches whatever the first reviewer missed
- Automated checks on every change, human review focused on high-risk areas, sampled audits of the rest, and capped intake

Check answer

### Show answer

Answer: Automated checks on every change, human review focused on high-risk areas, sampled audits of the rest, and capped intake. When generation outpaces review, human attention is the scarce resource and has to be spent where risk is highest. Tests, type checks, and calibrated AI review cover everything, people review changes to sensitive areas, audits keep the automated tier honest, and intake is limited so the queue does not force rubber stamps. Doubling approvals doubles a load that is already unsustainable, and agents approving agents removes independent oversight.

Agent fleet operations for software delivery

A team wants an agent to act as first responder when the main branch build fails outside working hours. Which design is appropriate?

- The agent reverts the most recent commit on main immediately, whatever the cause of the failure turns out to be
- The agent reruns the failed job until it passes, and reports the failure only if ten consecutive reruns fail
- The agent investigates, opens a pull request with a proposed fix and evidence, and escalates to on-call when unsure
- The agent pushes its fix straight to main so that the build is green by morning, and posts a summary for the team

Check answer

### Show answer

Answer: The agent investigates, opens a pull request with a proposed fix and evidence, and escalates to on-call when unsure. An unattended responder should shorten diagnosis without taking irreversible or unreviewed actions: gather evidence, propose a change through the normal review path, and hand off with a clear summary when confidence is low or a time or cost budget runs out. Automatic reverts and direct pushes bypass review at the moment judgment matters most, and rerunning until green hides real failures behind flaky ones.

Cost and latency optimization at scale

A nightly job generates summaries for 50,000 documents. Each request shares the same 30,000-token instruction block, and the job currently runs synchronously during business hours at full price. Nobody reads the output before morning. Which design lowers cost most?

- Keep the job synchronous but stream each response, so that the workers can release their connections sooner
- Move the job to batch processing and cache the shared block with the longer cache lifetime, since the discounts combine
- Keep the job synchronous but send a zero-output warm-up request before each document to prime the cache
- Move the job to batch processing but leave caching off, since batch requests cannot make use of the prompt cache

Check answer

### Show answer

Answer: Move the job to batch processing and cache the shared block with the longer cache lifetime, since the discounts combine. Work that nobody waits for belongs in batch processing, which is discounted, and the batch discount applies on top of cache pricing. Because batch requests may be processed more than five minutes apart, the one-hour cache lifetime gives better hit rates, though hits inside a batch are best effort. Streaming does not change price, and a warm-up before every document adds a request per document for a prefix that steady traffic already keeps warm.

Cost and latency optimization at scale

In one agent turn the model requests five independent read-only lookups. The harness runs them one after another at about 800 milliseconds each and returns each result in its own user message. Later turns show the model requesting one tool at a time. What should the harness do?

- Cache every lookup result for twenty-four hours, so that repeated lookups in later turns return without delay
- Raise the reasoning effort, so that the model plans its lookups better and needs fewer of them in each turn
- Run independent read-only calls concurrently, and return all of their results together in a single user message
- Disable parallel tool use in the request, so that the model's behavior matches how the harness executes the calls

Check answer

### Show answer

Answer: Run independent read-only calls concurrently, and return all of their results together in a single user message. When the model asks for several independent calls at once, running them concurrently turns five waits into one. The results belong in one user message: splitting them across messages teaches the model to stop requesting calls in parallel, which is the drift this team observes. Disabling parallel calls locks in the slow path, and caching helps only when the same lookup repeats.

Production integration, reliability, and knowledge grounding

A document-analysis endpoint sets a large max_tokens. For very long inputs, responses arrive as HTTP 200 with stop_reason model_context_window_exceeded and a partial answer. The fallback policy treats any stop other than a normal finish as an outage and replays the request in a second region, where the same thing happens. What is the right handling?

- Keep the regional replay but add exponential backoff, so that the second region has time to free up its context capacity
- Raise max_tokens to the model's maximum on the replay, so that the response has enough room to finish its answer
- Return the partial answer as final, since a response delivered with HTTP 200 is complete by definition
- Treat it as truncation caused by input size: count tokens up front, shrink or split the input, and mark partial output

Check answer

### Show answer

Answer: Treat it as truncation caused by input size: count tokens up front, shrink or split the input, and mark partial output. This stop reason means generation ran into the model's context window before reaching max_tokens: the response is valid but truncated, and the cause is the size of the input plus output, not a regional fault. Replaying the same request anywhere reproduces it. The fix is upstream: count tokens before sending, then trim, split, or compact the input, and never present the partial text as complete. max_tokens was not the limit that was reached.

Production integration, reliability, and knowledge grounding

An event-driven summarizer pulls from a queue. An upstream burst raises the event rate tenfold. Workers autoscale on queue depth and each retries its 429s in place, so rate-limit errors multiply, queue depth keeps growing, and the latency objective is missed for hours. What design handles bursts?

- Concurrency bounded by token throughput, a shared retry budget, and backpressure that defers low-priority events
- Faster autoscaling on queue depth, so that enough workers come online to drain the queue before latency is affected
- A longer per-request timeout and a higher retry limit, so that each worker eventually completes the event it holds
- Streaming on every summarization request, so that workers receive output sooner and can pick up the next event

Check answer

### Show answer

Answer: Concurrency bounded by token throughput, a shared retry budget, and backpressure that defers low-priority events. When the provider's rate limit is the bottleneck, adding workers adds rejected requests, not throughput. The consumer should be sized to the token throughput it is allowed, pace itself from rate-limit headers, cap retries across the fleet, and push back on producers or defer low-priority work when the queue grows. Longer timeouts and more retries hold events longer without raising the ceiling.

Production integration, reliability, and knowledge grounding

After a team routes its Claude traffic through a new internal gateway, the prompt cache hit rate falls to zero and a beta feature starts returning errors. Direct calls with the same application code behave normally. Investigation finds that the gateway inserts a per-request trace id at the top of the system prompt and drops headers it does not recognize. What should change?

- Have the gateway retry any request that returns an error, so that the beta feature succeeds on a later attempt
- Move the cache breakpoint to the end of each request, so that the trace id is included in what gets cached
- Forward provider headers unchanged, keep trace ids out of the prompt body, and add a gateway parity test
- Raise the cache lifetime to one hour at the gateway, so that entries survive the extra latency the gateway adds

Check answer

### Show answer

Answer: Forward provider headers unchanged, keep trace ids out of the prompt body, and add a gateway parity test. A gateway must be transparent to the features behind it. Text injected at the start of the prompt changes the prefix on every request and defeats caching, and a dropped beta or version header turns a valid request into an invalid one. Trace context belongs in headers or metadata, and a parity test in CI catches the next divergence. Longer lifetimes and moved breakpoints cannot help a prefix that is unique per request.

Production integration, reliability, and knowledge grounding

A compliance assistant must show the exact source passage behind each claim. Today the prompt asks the model to quote its sources, and reviewers find quotes that are slightly altered. The team also wants the final answer as schema-constrained JSON. What works?

- Enable citations on the source documents, read the cited spans from the response, and build the JSON in application code
- Keep prompt-based quoting and run a fuzzy string match afterwards to correct each quote against the source text
- Enable citations and a JSON output schema on the same request, then read the citation spans out of the JSON fields
- Keep prompt-based quoting and add a JSON schema field for each quote, so that the schema forces the quotes to be exact copies

Check answer

### Show answer

Answer: Enable citations on the source documents, read the cited spans from the response, and build the JSON in application code. With the citations feature the API returns the cited text and its location extracted from the documents you supplied, so the quotes are valid pointers rather than model-written text. Citations interleave citation blocks with text and cannot be combined with schema-constrained output in one request, so the structure is assembled afterwards or in a second step. A schema constrains shape, not truth, and fuzzy matching repairs quotes without proving the claim was grounded.

Production integration, reliability, and knowledge grounding

A question-answering assistant covers a monorepo that changes every hour. The embedding index is always stale, rebuilding it is expensive, and good answers require following references from one file to another. Which retrieval architecture fits?

- A full re-embedding of the monorepo every hour, so that the vector index is never more than one hour behind the code it describes
- The whole monorepo loaded into the context window on every query, so that nothing has to be retrieved at all
- Larger chunks of several hundred lines each, so that more of the cross-file references fall inside a single chunk
- Agentic search: give the model search and read tools to locate content at query time, accepting more latency per query

Check answer

### Show answer

Answer: Agentic search: give the model search and read tools to locate content at query time, accepting more latency per query. For fast-changing, highly linked content, letting the model search and read on demand removes the stale-index problem and suits multi-hop questions, at the price of more calls and tokens per query. Static retrieval works best when content is stable and questions map to single passages. Hourly re-embedding is the expensive rebuild the team already cannot afford, and bigger chunks dilute relevance without following references.

Production integration, reliability, and knowledge grounding

A policy assistant answers every question, including ones its retrieval step returns only weakly related passages for, and users have acted on confident but unsupported answers. Which grounding practice addresses this?

- Make abstention a designed outcome: answer only from retrieved sources, say when they fall short, and evaluate both
- Double the number of passages placed in context, so that a relevant passage is more likely to be among them
- Ask the model for a confidence percentage with each answer, and hide any answer whose stated confidence is under 70
- Append a standard disclaimer to every answer saying that the content may be inaccurate and should be verified

Check answer

### Show answer

Answer: Make abstention a designed outcome: answer only from retrieved sources, say when they fall short, and evaluate both. Grounded systems need a supported way to say the sources do not answer the question, and evals must cover both directions: answering when support exists and declining when it does not. A blanket disclaimer carries no information about a particular answer, a self-reported percentage is not a calibrated signal, and more weak passages give the model more material to over-read.

Advanced agent architecture and orchestration

Using the Claude Agent SDK, a team forks a session so that two branches can try different fixes for the same bug in parallel. Both branches run in the same working directory, and their edits overwrite each other. Why, and what is the fix?

- Forks snapshot files when they are created, so the overwrite is a defect: retry the fork until the snapshots hold
- Forks inherit the parent's permission mode, so both branches edit freely: set both branches to plan mode instead
- A fork copies conversation history, not the filesystem: give each branch its own worktree or directory for edits
- Forks share one conversation history, so each branch reads the other's turns: use resume with separate ids instead

Check answer

### Show answer

Answer: A fork copies conversation history, not the filesystem: give each branch its own worktree or directory for edits. Forking creates a new session that starts from a copy of the conversation, while file edits remain real changes in whatever directory the session runs in. Parallel branches therefore need separate working trees, or file checkpointing if the aim is to revert one branch's changes. The histories are independent after the fork, and plan mode would stop the edits rather than isolate them.

Advanced agent architecture and orchestration

A multi-day agent is midway through a task when its model is scheduled for retirement. Its only record of progress is the raw conversation transcript. What design would let a task like this survive the model change?

- Compress the transcript into one long summary message, and resume the same session on the new model with it
- Keep progress in model-independent artifacts such as a task ledger and plan, and start a new session from them
- Replay the transcript to the new model with a note that a different model wrote it and that it should carry on
- Pause every long-running task for the week of the migration, and restart each one from the beginning afterwards

Check answer

### Show answer

Answer: Keep progress in model-independent artifacts such as a task ledger and plan, and start a new session from them. A transcript is a fragile carrier of state across models: prompt caches are scoped to a model, and behavior tuned around one model's habits does not transfer cleanly. Durable artifacts that any model can read let a new session pick up the task at a clean boundary, and the switch can then be validated with evals. Replaying or summarizing the old transcript keeps the state implicit, and restarting discards days of work.

Advanced agent architecture and orchestration

Twelve product teams each maintain a hand-rolled agent loop. Permission handling, hooks, context management, and session persistence differ in every one, and three incidents this quarter traced back to gaps in a team's loop. What should the platform team standardize?

- One wiki page of recommended practices, leaving each team free to apply them to its own loop as it sees fit
- One new in-house framework written from scratch, with adoption starting once it covers every team's needs
- One supported harness that provides the loop, permissions, hooks, subagents, and sessions, with reviewed exceptions
- One mandatory system prompt for all twelve agents, so that every team's agent follows exactly the same behavioral rules

Check answer

### Show answer

Answer: One supported harness that provides the loop, permissions, hooks, subagents, and sessions, with reviewed exceptions. The incidents come from each team re-implementing the same infrastructure with different gaps. A common harness, such as an agent SDK or a managed agent platform, makes the loop, permission checks, hooks, and persistence shared, tested components, and reusable patterns travel with it. A shared prompt does not fix loop infrastructure, a wiki depends on twelve teams applying it, and a from-scratch framework delays the fix and adds a thirteenth loop.

Advanced agent architecture and orchestration

An agent has about 300 tools from five MCP servers. To save tokens, a router sends a different subset of tool definitions on each turn, chosen by a classifier. Input cost goes up instead of down. Why, and what should replace the router?

- Changing the tool list rewrites the start of the prompt and breaks the cache: keep it stable and defer loading
- The subsets are too large: halve their size so that each turn carries fewer tool definitions than it does now
- The classifier adds a model call per turn: replace it with keyword rules that choose the subset without a call
- The definitions are too long: rewrite each tool description in one line so that all 300 fit in a smaller prefix

Check answer

### Show answer

Answer: Changing the tool list rewrites the start of the prompt and breaks the cache: keep it stable and defer loading. Tool definitions render at the very front of the prompt, so a different set on each turn invalidates the cached system prompt and conversation behind it. Declaring the full catalog once with deferred loading and letting the model find tools through tool search keeps the prefix stable, because discovered definitions are appended rather than swapped. Cheaper routing and shorter subsets still rewrite the prefix every turn.

Observability and production monitoring

After a release that adds the current date and time to the system prompt, an agent's input cost triples. Nothing errors and no alert fires, and the change is found three weeks later on the invoice. Which instrumentation would have caught and localized it?

- A unit test asserting that the system prompt block still carries its cache marker after every change to the prompt assembly code
- An alert on the share of input read from cache per route, plus a diff of consecutive request payloads to find the change
- An alert on the rate of 4xx and 5xx responses from the model API, evaluated per route over a rolling one-hour window
- A dashboard of average prompt length per route, reviewed each week for unexpected growth in the tokens sent

Check answer

### Show answer

Answer: An alert on the share of input read from cache per route, plus a diff of consecutive request payloads to find the change. A broken cache fails silently: requests succeed and only the usage fields change. The share of input tokens served from cache is the signal to alert on, and comparing consecutive payloads, or using cache diagnostics where available, shows the first byte that differs. A marker can be present while every request misses, error rates stay flat, and prompt length barely moves when a timestamp is added.

Observability and production monitoring

A security lead wants to detect a leaked API key being used by an outsider. The team's application traces cover the requests its own services send. Which data source should the detection be built on?

- The monthly invoice, comparing the total with the forecast and investigating any month with a large variance
- The application logs, alerting on prompts that do not resemble anything the product's features would send
- The application traces, alerting when the hourly span count for any service rises well above its usual level for that hour
- The provider's usage reporting grouped by API key and workspace, alerting on deviation from each key's baseline

Check answer

### Show answer

Answer: The provider's usage reporting grouped by API key and workspace, alerting on deviation from each key's baseline. Requests made by an outsider never pass through your instrumented services, so your traces and logs cannot see them, and exported spans are best-effort rather than a complete record. Usage reporting from the provider counts every request against the key that made it, which makes per-key baselines and anomaly alerts possible. An invoice review finds the problem weeks late.

Observability and production monitoring

Every sampled trace for an agent looks healthy: tasks succeed and no step is slow. Yet cost per task has doubled since the last release, which changed one tool description. Which analysis is most likely to explain it?

- Check the model API's latency and error dashboards for the release window, looking for a provider-side change
- Compare per-task distributions of turns, tool calls by tool, and tokens between the two releases to see what shifted
- Open the slowest trace of the week and read it step by step, looking for the single call that took the longest to finish
- Review the traces that ended in an error since the release, and group them by the type of error they reported

Check answer

### Show answer

Answer: Compare per-task distributions of turns, tool calls by tool, and tokens between the two releases to see what shifted. Some regressions are invisible in any single trace because each run looks reasonable: the change is in the distribution. Aggregating turns, calls per tool, and tokens per task by release shows, for example, that a reworded description made the agent call a search tool twice as often. Reading individual slow or failed traces inspects the wrong population, since these tasks are neither slow nor failing.

Evaluation engineering and quality assurance

A retrieval-grounded assistant is evaluated only on end-to-end answer correctness. When the score drops four points after a release that touched both the index and the prompt, nobody can tell which change caused it. What should the suite add?

- A single judge score for overall answer quality, reported next to the existing correctness score for each case
- Retrieval latency and index size per release, so that changes to the index are visible alongside the answers
- More end-to-end cases, so that the same correctness score rests on a larger and more varied set of questions
- Stage metrics: retrieval recall and precision against labeled passages, and groundedness of the answers

Check answer

### Show answer

Answer: Stage metrics: retrieval recall and precision against labeled passages, and groundedness of the answers. An end-to-end score cannot attribute a regression. Retrieval metrics against labeled relevant passages show whether the right material was found, and groundedness shows whether the answer stayed within it, so a drop can be assigned to the index or to the prompt. More end-to-end cases sharpen the same blended number, and latency or index size describe operations rather than quality.

Evaluation engineering and quality assurance

A nightly eval reports a six-point drop. Investigation shows that 6% of cases hit rate-limit errors after retries were exhausted, and the harness scored each of them as a failed answer. How should the harness treat such cases?

- Score them as failures, as it does now, since a conservative number is the safer one to report to release owners
- Score them as passes, since the model was never given the chance to answer and should not be penalized for it
- Record them as harness errors outside the pass rate, retry with backoff, and invalidate runs with too many of them
- Drop them without a record and report the pass rate over the remaining cases, so that the headline stays clean

Check answer

### Show answer

Answer: Record them as harness errors outside the pass rate, retry with backoff, and invalidate runs with too many of them. An eval must separate plumbing from model behavior. Cases that never produced a gradable output belong in an error category with their own count, retried with backoff, and a run with too many of them should be declared invalid rather than averaged. Scoring them as failures or passes puts infrastructure noise into the quality number, and dropping them unrecorded hides both the outage and any bias in which cases were lost.

Evaluation engineering and quality assurance

An LLM judge agrees with human labels on 70% of cases. Before tuning the judge further, the team has a second person label the same cases, and the two people agree with each other on only 72%. What does this show, and what should happen next?

- The labeled set is too small: have the same two raters label three times as many cases with the same guide
- The judge is noisy: run it three times per case and take the majority verdict before comparing it with people
- The rubric is ambiguous: human agreement is the judge's ceiling, so tighten criteria and adjudicate labels
- The judge needs a more capable model: upgrade it and measure agreement with the first rater's labels again

Check answer

### Show answer

Answer: The rubric is ambiguous: human agreement is the judge's ceiling, so tighten criteria and adjudicate labels. A judge cannot agree with human labels more reliably than people agree with each other. Low inter-rater agreement points at unclear criteria or genuinely ambiguous cases, so the first fix is the rubric and an adjudicated label set, after which judge calibration means something. A stronger judge, more labels from the same guide, or majority voting all optimize against a noisy target.

Evaluation engineering and quality assurance

A support agent's online quality metric is the share of conversations that end without escalation to a person. The metric has risen steadily, while repeat contacts about the same issue have also risen. What is a better measurement for an agentic task?

- Verified resolution on sampled sessions: end-state checks and no repeat contact, with failures fed into the evals
- Sentiment of the customer's final message, scored by a classifier and averaged across all of the day's conversations
- Average conversation length in turns, on the assumption that shorter conversations mean the issue was resolved faster
- Number of tool calls per conversation, on the assumption that more actions taken means more problems were solved

Check answer

### Show answer

Answer: Verified resolution on sampled sessions: end-state checks and no repeat contact, with failures fed into the evals. Absence of escalation also counts customers who gave up, so the metric can improve while outcomes worsen. For an agent that acts, quality is whether the task was actually completed: the refund issued, the setting changed, the issue not reopened. Sampled sessions checked against end state give that signal and supply new regression cases. Length, sentiment, and activity are proxies that can all move the wrong way.

Runtime guardrails and production security

A regulated service passes every model response through an output guardrail service. The guardrail times out on about 2% of calls, and in that case the application sends the unchecked response to the user. What should the behavior be?

- Retry the guardrail call without limit until it answers, holding the user's response for as long as that takes
- Fail closed for high-risk categories with a safe fallback response, and track guardrail availability as an SLI
- Remove the guardrail from the request path and run it asynchronously, flagging problem responses after delivery
- Reuse the verdict from the most similar earlier response whenever the guardrail call exceeds its time limit

Check answer

### Show answer

Answer: Fail closed for high-risk categories with a safe fallback response, and track guardrail availability as an SLI. A guardrail that fails open is absent exactly when it is under stress. Where a missed check carries regulatory or safety risk the safe default is to withhold the response and return a designed fallback, while lower-risk categories may be allowed through. The guardrail is a dependency with its own indicators and alerts. Asynchronous checks detect rather than prevent, unbounded retries trade one failure for a hung request, and a borrowed verdict was never computed for this response.

Runtime guardrails and production security

Developers in a company connect their agents to third-party MCP servers of their own choosing. One server, approved months ago, ships an update whose tool descriptions now contain hidden instructions to read local credential files. Which configuration practice defends against this?

- Prefer servers that are widely used and well rated in public registries, since popular servers are safer to trust
- Remove tool descriptions from the context window, so that nothing a server writes there can reach the model
- Allowlist vetted servers, pin versions, review changes to tool definitions, and scope what each server can reach
- Scan each server's tool descriptions once when it is first installed, and record the scan result with the approval

Check answer

### Show answer

Answer: Allowlist vetted servers, pin versions, review changes to tool definitions, and scope what each server can reach. Tool descriptions are untrusted content that the model reads as guidance, and they can change after approval. An allowlist limits which servers can connect, pinning and change review catch a poisoned update, least-privilege scopes limit what a compromised server can reach, and approval gates on sensitive tools hold whatever a description says. A one-time scan misses later changes, popularity is not a control, and without descriptions the model cannot use tools correctly.

Runtime guardrails and production security

An agent needs to call an internal API from its sandbox. For convenience the team places the API token in the system prompt, so that the model can add it to the commands it writes. What is the right pattern?

- Encode the token before placing it in the system prompt, and tell the model how to decode it when building a command
- Rotate the token every week, so that a copy that leaks from the conversation is only usable for a short time
- Keep the token in the system prompt, and add an instruction that it must never be repeated in any response
- Keep the secret out of the model's context and sandbox, and have a tool or egress proxy attach a scoped credential

Check answer

### Show answer

Answer: Keep the secret out of the model's context and sandbox, and have a tool or egress proxy attach a scoped credential. Anything in the context window can be echoed, logged in traces, or extracted by injected content, so secrets should never be there. A tool wrapper or an egress proxy that injects a narrowly scoped, short-lived credential lets the call succeed while the model and the sandbox only ever see a placeholder. Encoding is not protection, an instruction is not a control, and rotation limits the damage of a leak that the design still permits.

Advanced debugging and incident response

A policy assistant keeps omitting exceptions from its answers. In failing traces the retrieved chunk ends in the middle of a clause, and the exception that completes it sits at the start of the next chunk, which was not retrieved. The model's answer is faithful to the text it was given. Where is the fault, and what is the fix?

- Chunking: fixed-size splits cut rules from their exceptions, so split on document structure and retrieve neighbors
- Generation: the model is summarizing too aggressively, so instruct it to always list exceptions to any rule it states
- Reranking: the reranker scores the exception chunk too low, so replace it with a model trained on policy text
- Retrieval depth: too few chunks reach the context, so pass the top twenty chunks to the model instead of the top five

Check answer

### Show answer

Answer: Chunking: fixed-size splits cut rules from their exceptions, so split on document structure and retrieve neighbors. The answer matches the retrieved text, so generation is working: the defect is that indexing separated a rule from its exception. Structure-aware chunking, overlap, or retrieving the surrounding section keeps related clauses together. An instruction to list exceptions cannot surface text the model never saw, and the exception chunk alone scores poorly for the question because, cut from its rule, it barely mentions the topic.

Advanced debugging and incident response

A team discovers that for six hours a bug has caused an agent to write incorrect values into about 1,300 records across several tenants, and the agent is still running. What is the right order of response?

- Ship a fix for the bug, then let the agent make a correction pass over its own records, then inform the tenants
- Establish the full root cause first, so that the first message to tenants can explain exactly what went wrong
- Disable the agent's write path, scope the affected records from the audit log, notify stakeholders, then remediate
- Delete the records the agent touched in the last six hours, restore them from backup, then restart the agent

Check answer

### Show answer

Answer: Disable the agent's write path, scope the affected records from the audit log, notify stakeholders, then remediate. Containment comes first: every minute the agent keeps writing enlarges the incident. The audit log then defines the blast radius, stakeholders get facts and a time for the next update, and remediation is driven by that record. Letting the agent repair its own output trusts the component that failed, waiting for root cause delays notification, and a bulk delete and restore destroys legitimate writes made in the same window.

Advanced debugging and incident response

Answer quality on sampled traffic degrades sharply at 09:10. Nothing was deployed by the team in the previous three days. What should the on-call engineer check first?

- Last week's deployment, rolling it back as a precaution since it is the most recent change that the team made
- The service's host metrics, restarting every instance in turn to clear any state that may have built up over time
- What changed outside the team's deploys: the served model version, tool dependencies, index refreshes, and input mix
- The reasoning effort setting, raising it across all routes until the sampled quality score recovers to its old level

Check answer

### Show answer

Answer: What changed outside the team's deploys: the served model version, tool dependencies, index refreshes, and input mix. An LLM system can regress without a deploy because several of its inputs change on their own: a model alias can move, a tool's upstream API can change its responses, a retrieval index can refresh with bad data, and users can start sending different inputs. Telemetry sliced by those dimensions narrows it quickly. Rolling back an unrelated release or restarting hosts changes things that did not change at 09:10.

Agent fleet operations for software delivery

Fleet telemetry for coding agents shows that 30% of runs end at the turn limit and that cost per merged pull request has tripled. Grouped by repository, almost all of the affected runs are in repositories whose project instructions do not say how to build or run tests. What is the right response?

- Raise the turn limit across the fleet, so that agents have enough turns left to work out how each repository builds
- Move the affected repositories to a more capable model, so that agents infer the build and test steps faster
- Reduce the number of agents running in parallel, so that total fleet spend falls back toward its earlier level
- Fix the shared setup: document build and test commands in those repositories and prepare dependencies before runs start

Check answer

### Show answer

Answer: Fix the shared setup: document build and test commands in those repositories and prepare dependencies before runs start. The cohort view points at a configuration gap rather than at the agents: runs burn turns discovering how to build and test. Supplying that knowledge once in project instructions and preparing the environment removes the waste for every future run. A higher turn limit pays for the same discovery each time, a stronger model still has to discover it, and less parallelism lowers total spend without fixing cost per merged change.

Agent fleet operations for software delivery

A nightly dependency-upgrade agent runs headless for several hours. Some nights it stalls on a permission request that nobody is there to answer, and other nights it dies partway through and loses all of its progress. Which design fits an unattended run?

- Run it with all permission checks bypassed on the shared build host, so that no request can ever stall the run
- Pre-approve needed tools and deny the rest without prompting, cap turns and cost, checkpoint to a branch, and notify
- Double the job timeout, and add an automatic restart from the beginning whenever the process exits early
- Run it inside a persistent terminal session, so that an engineer can attach in the morning and answer what is pending

Check answer

### Show answer

Answer: Pre-approve needed tools and deny the rest without prompting, cap turns and cost, checkpoint to a branch, and notify. Unattended runs need decisions made in advance: an allowlist of tools, a mode that denies rather than waits when something would prompt, and limits on turns and spend. Progress committed to a branch with a status record lets a rerun resume, and a notification reports the outcome. Bypassing every check on a shared host removes the safety net where credentials live, and restarting from the beginning repeats hours of work.

Agent fleet operations for software delivery

Teams in a company share Skills and MCP server configurations by pasting them into chat channels. A widely copied skill contained a script with a defect that produced bad commits in several repositories before anyone traced the source. What governance should the company adopt?

- A central platform team that writes every skill and server configuration on request for the product teams
- A ban on sharing between teams, with each team writing and maintaining every skill and server it uses itself
- An open internal catalog where anyone can publish at once, ranked by how many teams have installed each item
- An internal catalog with owners, review of bundled scripts, versioning, and a quality bar, backed by an allowlist policy

Check answer

### Show answer

Answer: An internal catalog with owners, review of bundled scripts, versioning, and a quality bar, backed by an allowlist policy. Shared agent extensions are code that runs with developers' permissions, so they need what shared code needs: an owner, review that includes any scripts, versions that can be pinned and rolled back, and evidence that they work. Organization policy can then restrict agents to approved sources and servers. A ban forfeits reuse, popularity ranking spreads defects faster, and a central team writing everything becomes a bottleneck.

Agent fleet operations for software delivery

Finance wants coding agent spend attributed to teams, and security wants all model traffic to pass through the company gateway. Several hundred developers use the agent. How should this be rolled out?

- Distribute telemetry export with team attributes and the gateway endpoint through managed settings, then verify on machines
- Skip client configuration and split the monthly invoice by API key, assigning one key to every team that uses the agent
- Ask each developer to export the telemetry and gateway variables in a shell profile, and verify adoption with a survey
- Commit the telemetry exporter settings to each repository's project settings, so that they travel with the code

Check answer

### Show answer

Answer: Distribute telemetry export with team attributes and the gateway endpoint through managed settings, then verify on machines. Organization-wide behavior belongs in centrally managed settings, which developers cannot override and which reach every machine: telemetry export with resource attributes for team attribution, and the base URL and credentials for the gateway. Repository settings are the wrong scope for this, and Claude Code ignores telemetry exporter variables set there. Shell profiles drift, and invoice splitting by key gives monthly totals without per-session detail or routing control.

Cost and latency optimization at scale

A B2B platform sells plans with monthly usage allowances. One tenant's automation consumes eight times its allowance in a week. The only control in place is an organization-level spend limit, which would stop every tenant if it were reached. What should the platform build?

- A smaller max_tokens for every tenant's requests, so that no single request can produce a large amount of output
- A separate API key for each tenant, with usage per key reviewed against plan allowances at the end of the month
- A lower organization-level spend limit, so that total spend is capped well before any one tenant can run it up
- Per-tenant metering from response usage in its own gateway, with alerts and soft and hard limits that throttle

Check answer

### Show answer

Answer: Per-tenant metering from response usage in its own gateway, with alerts and soft and hard limits that throttle. Budget enforcement per tenant has to live where the tenant is known: the platform's own request path. Metering from the usage fields of each response gives near-real-time totals, thresholds trigger alerts, and soft and hard limits decide whether to throttle, switch to a cheaper route, or refuse with a clear message. An organization limit is a blunt backstop that punishes everyone, and month-end review notices the overrun after the money is spent.

Cost and latency optimization at scale

A forecast for an agent product multiplied the average tokens per model call by the expected number of calls. Actual spend on long tasks is four times the forecast. What did the model get wrong, and how should it be rebuilt?

- Retries were left out: add a fixed percentage uplift to the forecast to cover the requests that are sent twice
- Traffic grew faster than planned: scale the forecast by the ratio of actual task volume to expected task volume
- Each turn re-sends the growing history, so cost outpaces turn count: model per-task distributions, cache reads, and the tail
- Output tokens were priced at the input rate: reprice the output tokens and keep the same average-based structure

Check answer

### Show answer

Answer: Each turn re-sends the growing history, so cost outpaces turn count: model per-task distributions, cache reads, and the tail. In an agent loop every call carries the whole conversation so far, so input tokens per task grow roughly with the square of the number of turns, and caching reprices that input rather than removing it. A sound model works from distributions per task: turns, cumulative input split into cached and uncached, output, and above all the long tail, where a small share of tasks carries a large share of spend. Flat uplifts and volume scaling keep the linear assumption that failed.

Cost and latency optimization at scale

A classification route runs at the model's default reasoning effort. Its p95 latency misses the target, and traces show that reasoning accounts for most of the output tokens on what are mostly easy inputs. Which change should be tried first?

- A second replica of the service in another region, so that requests are served from closer to users
- A sweep of lower effort levels on the route's eval, adopting the lowest level that holds accuracy
- A retry with a shorter timeout, so that slow requests are abandoned and sent again more quickly
- A tight max_tokens on the route, so that responses are cut off before the reasoning can run long

Check answer

### Show answer

Answer: A sweep of lower effort levels on the route's eval, adopting the lowest level that holds accuracy. When reasoning dominates output on easy inputs, effort is the direct control: lower levels spend fewer tokens and return sooner, and an eval shows how far the route can step down before accuracy moves. max_tokens is a cap the model cannot see and produces truncated responses rather than shorter reasoning. Network distance is not where the time goes, and abandoning slow requests to resend them adds cost and load.

## Drill one domain at a time

Each domain with enough questions has its own page with study notes and just that domain's questions.

- [CCDV-P Production integration, reliability, and knowledge grounding questions](https://youraidept.com/network/ccdv-p-practice-questions/production-integration-reliability-and-knowledge-grounding) (20)
- [CCDV-P Advanced agent architecture and orchestration questions](https://youraidept.com/network/ccdv-p-practice-questions/advanced-agent-architecture-and-orchestration) (14)
- [CCDV-P Observability and production monitoring questions](https://youraidept.com/network/ccdv-p-practice-questions/observability-and-production-monitoring) (10)
- [CCDV-P Evaluation engineering and quality assurance questions](https://youraidept.com/network/ccdv-p-practice-questions/evaluation-engineering-and-quality-assurance) (12)
- [CCDV-P Runtime guardrails and production security questions](https://youraidept.com/network/ccdv-p-practice-questions/runtime-guardrails-and-production-security) (10)
- [CCDV-P Advanced debugging and incident response questions](https://youraidept.com/network/ccdv-p-practice-questions/advanced-debugging-and-incident-response) (9)
- [CCDV-P Agent fleet operations for software delivery questions](https://youraidept.com/network/ccdv-p-practice-questions/agent-fleet-operations-for-software-delivery) (10)
- [CCDV-P Cost and latency optimization at scale questions](https://youraidept.com/network/ccdv-p-practice-questions/cost-and-latency-optimization-at-scale) (7)

## How the real CCDV-P exam differs

- Questions: 70 items in 120 minutes, 60 of them scored
- Passing score: 720 on a 100 to 1,000 scale
- Exam fee: $175 per attempt, per the official 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-P exam questions? +

No. They are original scenario questions about running Claude systems in production, written from the published blueprint and Anthropic's public documentation, not exam content.

### Do I need CCDV-F before CCDV-P? +

No prerequisite is enforced. The exam guide recommends CCDV-F as preparation and treats its scope as assumed knowledge.

### What should I study most for CCDV-P? +

Production integration, reliability and knowledge grounding (20%) and advanced agent architecture and orchestration (17%) are the two largest domains. The other six each carry between 8% and 12%, so cover all of them: observability, evaluation engineering, runtime guardrails, incident response, agent fleet operations, and cost and latency.

### How many questions are on the real CCDV-P exam? +

70 questions in 120 minutes (60 scored, 10 unscored), proctored and closed-book, with a passing score of 720 on a 100 to 1,000 scale.

### Where do I register for CCDV-P? +

On the CCDV-P certification page in the Anthropic Partner Academy, which is open to people at Claude Partner Network organizations. From there you continue to Pearson VUE checkout, where you pay the $175 fee and pick a date, online proctored or at a test center. Independent engineers usually get Partner Academy access by joining a partner firm such as YAID.

## Practice questions for the other exams

CCAR-F

### [Claude Certified Architect – Foundations](https://youraidept.com/network/ccar-f-practice-questions)

CCDV-F

### [Claude Certified Developer – Foundations](https://youraidept.com/network/ccdv-f-practice-questions)

CCAO-F

### [Claude Certified Associate – Foundations](https://youraidept.com/network/ccao-f-practice-questions)

CCAR-P

### [Claude Certified Architect – Professional](https://youraidept.com/network/ccar-p-practice-questions)

## Who wrote this

### [Matei Olaru](https://youraidept.com/about/matei-olaru)

CEO, Your AI Department

Former public-company CEO, corporate attorney, and World Bank consultant. Runs the YAID Network and the partner relationship with Anthropic.

### [Michael Greenberg](https://youraidept.com/about/michael-greenberg)

AI Product Lead, Your AI Department

AI at Google, Meta, and Samsung. Six patents. Leads member support and the certification prep guidance.

Your AI Department is a registered Claude Partner Network company. Our members sit these exams under our partner standing. Facts on this page were last checked on November 25, 2026.

## Ready to sit CCDV-P for real?

Registration needs a Claude Partner Network organization. [YAID Network](https://youraidept.com/network) members register under our partner standing and prepare with the official Partner Academy course. $149 per quarter, exam fee separate.

[Apply to join YAID ↗](https://youraidept.com/network/apply?ref=practice)[How registration works →](https://youraidept.com/network/register-for-claude-certification)