Question 110
A document-processing agent invokes external services while extracting invoice fields. An extraction workflow repeats one expensive tool call after a transient error. What should be implemented at the appropriate boundary?
- Validate tool-call inputs against the declared argument schema
- Track pending work in durable application state until the actual result arrives
- Validate tool output against the expected result contract before reasoning
- Gate the payment tool behind authorization and confirmation before execution
- Apply a retry cap and bounded backoff outside the model
Explanation
Correct Answer
E:An application-owned retry policy prevents infinite loops and makes downstream reliability predictable under outages.
Incorrect Answers
A:Schema checking at the host boundary prevents type errors and unsafe side effects from malformed model-generated arguments; it protects against the case where a tool schema requires a numeric invoice total but Claude supplies a string, rather than the failure described here: an extraction workflow repeats one expensive tool call after a transient error.
B:A long-running call must not be represented as success before completion, especially where later steps depend on its output; that applies when tool execution takes several minutes, but the model has already emitted the request, whereas this case requires a response to an extraction workflow repeats one expensive tool call after a transient error.
C:This measure fits a different trigger: the OCR service sometimes returns an empty string rather than recognized text. In that setting, An empty result may reflect OCR failure, not an intentionally blank invoice field; validation stops it being promoted to fact; it does not resolve the present need to bound repeated recovery attempts.
D:Prompt wording alone is not a reliable transaction guard; the execution layer must verify that the action is approved; this is useful for a payment API can create a real charge, but model responses may be replayed, but it leaves the stated requirement to bound repeated recovery attempts unmet.
Question 111
A support agent returns structured case-resolution decisions. The model returns a Boolean eligibility flag but omits the reason for ineligibility. Which option best meets the operational need?
- Define typed decision, rationale, and policy-reference fields
- Include conditional reason fields tied to the decision status
- Validate nonempty identifiers and documented format requirements
- Use a controlled status enum plus an independent natural-language message
Explanation
Correct Answer
B:A yes/no value alone is often insufficient for safe escalation or customer communication when the answer is no. Here it serves the explicit need to require explanatory evidence for negative outcomes without adding a separate unverified inference.
Incorrect Answers
A:This measure fits a different trigger: a refund decision needs a rationale plus a reviewed policy reference. In that setting, A consistent structured record supports auditability and guards against free-form messages that omit why the decision was made; it does not resolve the present need to require explanatory evidence for negative outcomes.
C:Field-level constraints catch malformed records before downstream calls, although existence and authorization still require service checks; this is useful for the response schema accepts any account ID string, including empty values, but it leaves the stated requirement to require explanatory evidence for negative outcomes unmet.
D:Machines need stable state tokens, while humans need context; combining them in one free-form field weakens both uses; that applies when the output includes free-text status that downstream logic cannot branch on, whereas this case requires a response to the model returns a Boolean eligibility flag but omits the reason for ineligibility.
Question 112
A Claude Code repository is organized into multiple services with different local rules. A release policy document already exists and should not be copied into multiple instruction files. What is the most appropriate design choice?
- Delete or archive obsolete operational details from shared instructions
- Keep common conventions at root and isolate service-specific guidance
- Use a supported CLAUDE.md import or concise reference to the maintained document
- Use actual tool permissions and approval workflows for risky commands
Explanation
Correct Answer
C:Importing maintained guidance avoids parallel copies that drift when the release process changes. For the stated case, the check is whether the system can reference one source of truth; this approach supplies that control.
Incorrect Answers
A:Outdated incident context can mislead future tasks; persistent memory should contain durable conventions and verified references; that applies when the team's root file contains a temporary incident note from last month, whereas this case requires a response to a release policy document already exists and should not be copied into multiple instruction files.
B:This measure fits a different trigger: the root instructions list every service's commands and overwhelm simple tasks. In that setting, Layered instructions reduce irrelevant context while preserving shared policies that apply across the repository; it does not resolve the present need to reference one source of truth.
D:Instruction files can steer behavior but do not grant or enforce operating-system authorization by themselves; it protects against the case where a developer assumes an automatically loaded file authorizes privileged commands, rather than the failure described here: a release policy document already exists and should not be copied into multiple instruction files.
Question 113
A team uses Claude Code to implement a business-rule change. The team has a known bug with a reproducible failing test. Which response is most reliable?
- Run the reproducer, inspect the cause, then apply a minimal change
- Remove incidental changes and present a focused diff
- Validate the changed module and affected integration boundaries
- Update tests and plan based on the approved revised criteria
Explanation
Correct Answer
A:A known failure gives objective feedback; starting with a broad rewrite increases unrelated regression risk. The relevant requirement is to use the test as the starting failure signal, and this measure operates at that decision point.
Incorrect Answers
B:A small diff improves reviewability and makes unintended consequences easier to detect; that applies when the generated patch contains unrelated formatting changes, whereas this case requires a response to the team has a known bug with a reproducible failing test.
C:A local green test is not enough when shared interfaces are modified; neighboring consumers need coverage; this is useful for the fix passes the reproducer but may affect adjacent modules, but it leaves the stated requirement to use the test as the starting failure signal unmet.
D:Continuing with an obsolete contract can produce polished but wrong code; the new requirements must govern validation; it protects against the case where a review discovers the acceptance criteria changed mid-implementation, rather than the failure described here: the team has a known bug with a reproducible failing test.
Question 114
A Claude-based coding assistant generates patch-review records. A finding names an API method that has been removed. What should the team do to resolve this particular gap?
- Run permitted commands and report any unavailable or failing test conditions
- Mark missing checks as blocked and do not assign a passing verdict
- Request targeted correction while retaining validated findings
- Cross-check referenced symbols with source or build metadata
Explanation
Correct Answer
D:Factual checking must follow formatting validation because a correctly typed nonexistent method is still an invalid finding.
Incorrect Answers
A:Describing test commands does not prove they are executable or passing; CI evidence is required; this is useful for the assistant proposes tests that do not run in the current build, but it leaves the stated requirement to verify symbol existence before asserting a defect unmet.
B:A fluent summary cannot turn skipped checks into evidence; state should reflect actual execution results; it protects against the case where the model returns a plausible patch summary even though required static checks were skipped, rather than the failure described here: a finding names an API method that has been removed.
C:Narrow repair reduces regression risk and prevents fresh hallucinations in sections that already passed checking; that applies when a correction retry rewrites already verified findings unnecessarily, whereas this case requires a response to a finding names an API method that has been removed.
Question 115
A code analysis service accepts Claude-generated review findings. The pipeline needs severities that match its existing triage labels. Which control is most directly relevant?
- Declare an enum aligned to the triage system
- Verify referenced symbols and locations against the actual code revision
- Use a typed finding schema that permits a null path only for global findings
- Require an array of test strings or typed test objects
- Define whether extra keys are permitted and enforce that contract
Explanation
Correct Answer
A:Controlled labels avoid synonyms that break deterministic routing and reporting. This matches the workflow goal to make severity a controlled vocabulary rather than introducing an unrelated action.
Incorrect Answers
B:A well-formed schema cannot prove an architectural claim is true; source checks are still necessary; it protects against the case where a review is structurally valid but flags a function absent from the repository, rather than the failure described here: the pipeline needs severities that match its existing triage labels.
C:This measure fits a different trigger: a file path can be missing for repository-wide design findings. In that setting, Conditional optional fields prevent fabricated paths while retaining precise locations for line-specific defects; it does not resolve the present need to make severity a controlled vocabulary.
D:Arrays are safer for downstream automation than a single comma-delimited paragraph that could be parsed ambiguously; this is useful for a review record must contain an array of recommended tests, but it leaves the stated requirement to make severity a controlled vocabulary unmet.
E:Unknown fields should have a deliberate policy; silent acceptance can hide model drift, while arbitrary rejection can break legitimate extensibility; that applies when the downstream parser rejects a valid JSON object because an unexpected property appears, whereas this case requires a response to the pipeline needs severities that match its existing triage labels.
Question 116
An engineering company integrates Claude Code into a secure CI workflow. The pipeline requires a stable format for severity, path, and line number. How should the workflow be adjusted?
- Record the revision, prompt configuration, and tool versions for each run
- Use separate restricted runners or permission scopes for untrusted PR analysis
- Use schema-checked JSON findings with severity and source locations
- Grant only the API permission required for review comments and withhold repository-write capability
Explanation
Correct Answer
C:A validated contract lets downstream code render and deduplicate findings without trusting prose extraction. For the stated case, the check is whether the system can define and validate a review-output contract; this approach supplies that control.
Incorrect Answers
A:Traceable inputs help explain why findings changed and distinguish code changes from changes in review configuration; this is useful for a nightly review compares generated findings with a baseline, but it leaves the stated requirement to define and validate a review-output contract unmet.
B:A model that reads untrusted code should not share a security boundary with credentials capable of changing production; it protects against the case where the reviewer has access to production deployment credentials through the runner image, rather than the failure described here: the pipeline requires a stable format for severity, path, and line number.
D:This measure fits a different trigger: the job must comment on a PR but may not modify the branch. In that setting, Least privilege lets CI publish feedback without creating commits or changing protected source files; it does not resolve the present need to define and validate a review-output contract.
Question 117
A support workflow uses model-generated structured actions. A model response contains a correct enum but refers to the wrong customer ID. Which implementation decision is the best fit?
- Validate the record identity against the authenticated session
- Check postal-code validity with an authoritative service
- Route the request to the approval path without automatic replay
- Consult current quota state before committing the mutation
Explanation
Correct Answer
A:Schema matching cannot establish that a valid-looking identifier belongs to the authorized customer. The relevant requirement is to check cross-field and session integrity, and this measure operates at that decision point.
Incorrect Answers
B:This measure fits a different trigger: a proposed address change contains a nonexistent postal code. In that setting, A field can be a syntactically valid string while failing the external real-world requirement for a deliverable address; it does not resolve the present need to check cross-field and session integrity.
C:Authorization is not a text-generation defect; more model attempts cannot substitute for a missing approval; that applies when a service rejects a proposed mutation for insufficient approval, whereas this case requires a response to a model response contains a correct enum but refers to the wrong customer ID.
D:Current cumulative limits depend on external state and require an authoritative execution-time check, not just a schema; it protects against the case where an action payload validates but would exceed a daily transaction limit, rather than the failure described here: a model response contains a correct enum but refers to the wrong customer ID.
Question 118
A document classifier uses Claude to tag contracts with legal categories. The training examples use only one document style, but production inputs vary. What should the architect specify in the design?
- Select diverse boundary cases based on observed error patterns
- Choose examples from different layouts and writing styles while keeping the rubric stable
- Include labeled examples that explain how to break ties
- Show benign text that resembles the target but does not satisfy its criteria
Explanation
Correct Answer
B:Varied examples prevent the model from associating a label with incidental formatting instead of the clause meaning.
Incorrect Answers
A:A smaller curated set often gives clearer task guidance and avoids burying the decision rule under duplicated demonstrations; it protects against the case where the team has hundreds of redundant examples in a single prompt, rather than the failure described here: the training examples use only one document style, but production inputs vary.
C:This measure fits a different trigger: a particular clause belongs to two related categories but reviewers expect one primary label. In that setting, Examples should show which category wins at overlapping boundaries rather than leaving Claude to infer an unstated hierarchy; it does not resolve the present need to broaden demonstrations across document forms.
D:Negative cases calibrate the decision boundary more directly than adding more obvious positive examples; this is useful for reviewers identify recurring false positives from harmless boilerplate, but it leaves the stated requirement to broaden demonstrations across document forms unmet.
Question 119
A customer-support service drives Claude through an application-owned tool loop. The API replies with stop_reason=end_turn and no pending tool requests. Which change most directly addresses this condition?
- Return a tool_result marked as an error with a sanitized diagnostic
- Execute approved calls and return one result correlated to each tool-use identifier
- Use a stable transaction or idempotency key at the refund service
- Deliver the assistant's final content without dispatching another tool
Explanation
Correct Answer
D:An end-of-turn stop signals that the model has finished this turn; a fresh tool invocation would be an unauthorized extra operation rather than required orchestration.
Incorrect Answers
A:A structured failed result preserves the agent loop and lets the model choose recovery or escalation; fabricating successful data would hide the failure; that applies when a tool request fails because a backend times out, whereas this case requires a response to the API replies with stop_reason=end_turn and no pending tool requests.
B:Tool-use IDs associate responses with particular requests; matching both blocks prevents a result from being mistaken for another operation; this is useful for a single assistant message contains two independent tool_use blocks, but it leaves the stated requirement to recognize an already completed assistant turn unmet.
C:The model cannot guarantee exactly-once external side effects; an application-level key makes a repeated request resolve to the same transaction; it protects against the case where a state-changing refund tool may be retried after a dropped network connection, rather than the failure described here: the API replies with stop_reason=end_turn and no pending tool requests.
Question 120
An organization publishes MCP tools for searching internal technical documentation. A semantic-search tool returns ranked snippets that may not be complete documents. What is the most defensible next step?
- Describe deterministic lookup versus semantic search use cases explicitly
- Document optional fields, cursor behavior, and what confidence actually represents
- Document that search outputs are excerpts with source references and may need follow-up reads
- Validate and constrain readable paths in the tool implementation
- Specify its corpus, query shape, and result guarantees in the description
Explanation
Correct Answer
C:An explicit limitation discourages Claude from treating a truncated hit as authoritative coverage of a whole document.
Incorrect Answers
A:A direct identifier lookup gives precise retrieval when a key is known; embedding search is better for conceptual matching, not exact ID verification; it protects against the case where two tools share a capability, but one is optimized for exact identifier lookups, rather than the failure described here: a semantic-search tool returns ranked snippets that may not be complete documents.
B:Typed, well-described results let the agent distinguish absent values from negative findings and paginate without assumptions; that applies when a results object has optional confidence and pagination fields, whereas this case requires a response to a semantic-search tool returns ranked snippets that may not be complete documents.
D:Descriptions help selection but do not provide security; a server-side allowlist must protect unauthorized files; this is useful for a file-read tool accepts any path string and can access outside the workspace, but it leaves the stated requirement to state the limitations of retrieval results unmet.
E:This measure fits a different trigger: a tool named query has no indication of which index it searches. In that setting, Model selection depends on clear capability metadata; an opaque name leaves the assistant guessing which source will answer the user's question; it does not resolve the present need to state the limitations of retrieval results.