Question 30
A remote client asks to modify a record it does not own but supplies syntactically valid arguments. Which technical control is appropriate?
- Version and test server interfaces
- Use stdio for a local subprocess integration
- Validate operations in the server handler
- Advertise tool metadata clearly
Explanation
Correct Answer
C:Server handlers enforce identity, scope, and business rules before accessing protected systems, subject to this requirement: trusting the caller's description is not a security control.
Incorrect Answers
A:Compatibility tests and versioned rollout protect consumers from unexpected protocol or field changes; this cannot substitute for the behavior that server handlers enforce identity, scope, and business rules before accessing protected systems, because unreviewed changes can break integrations even when the server starts successfully.
B:Standard input and output suit tightly coupled local client-server interactions; in contrast, server handlers enforce identity, scope, and business rules before accessing protected systems, while the server's standard output must remain protocol-clean instead of mixing human debug prints.
D:The server supplies discoverable names, descriptions, and input schemas for the tool set; here, the controlling capability is that server handlers enforce identity, scope, and business rules before accessing protected systems, but misleading descriptions can cause inappropriate model tool selection.
Question 31
A user disputes an update allegedly performed by an assistant two hours earlier. What is the most suitable pattern?
- Authorize each requested resource operation
- Clearly distinguish a draft from a committed action
- Validate the caller's identity before exposing tools
- Audit committed business changes
Explanation
Correct Answer
D:An immutable audit trail records principal, approved action, object, time, and outcome; the implementation must still recognize that the final chat transcript is insufficient evidence of a backend write.
Incorrect Answers
A:Resource-level policy checks verify that the caller can execute that exact action on that object; this cannot substitute for the behavior that an immutable audit trail records principal, approved action, object, time, and outcome, because authentication alone does not confer access to all records.
B:Labels and separate commit controls prevent users from assuming a draft has been submitted; in contrast, an immutable audit trail records principal, approved action, object, time, and outcome, while model-generated wording should not make a simulated operation appear executed.
C:Authentication establishes which principal is making the request before access decisions; this addresses a separate concern, not the fact that an immutable audit trail records principal, approved action, object, time, and outcome; a conversational claim of ownership is not reliable proof of identity.
Question 32
A report generator continues adding sections when the business needs exactly three validated findings. Which choice should be used here?
- State the output task and audience explicitly
- Define measurable completion criteria
- Prioritize conflicting constraints in a policy
- Validate prompt variables before interpolation
Explanation
Correct Answer
B:Clear success conditions constrain content and make automated review feasible; asking for a comprehensive answer without boundaries creates scope drift.
Incorrect Answers
A:Clear instructions define the task, intended reader, and required level of technical detail; by comparison, the intended solution relies on this: clear success conditions constrain content and make automated review feasible; a vague request to be useful cannot anchor a reliable output format.
C:An explicit hierarchy identifies which requirements take precedence when they conflict, whereas the requirement calls for another behavior: clear success conditions constrain content and make automated review feasible; unresolved contradictory instructions can produce unpredictable omissions.
D:Input checks constrain length, types, and permitted resource scopes before prompt assembly; however, the critical mechanism here is that clear success conditions constrain content and make automated review feasible, and merely surrounding an unsafe value with quotation marks does not establish authorization.
Question 33
A tool needs to process coding-agent events incrementally rather than scrape pretty terminal text. Which of these alternatives serves the stated goal?
- Use a custom slash command for a named recurring action
- Use structured or streaming output for pipeline consumers
- Use a fresh isolated CI workspace
- Use non-interactive print mode for CI automation
Explanation
Correct Answer
B:Machine-friendly output formats allow programmatic consumers to handle individual events; the important constraint is that human-oriented terminal decoration is not a stable protocol contract.
Incorrect Answers
A:A named command exposes reusable prompt-driven workflow entry points inside Claude Code, whereas the requirement calls for another behavior: machine-friendly output formats allow programmatic consumers to handle individual events; a command definition still depends on the session's tool permissions and context.
C:Per-job isolation avoids file collisions and cross-run contamination; the requirement instead turns on this behavior: machine-friendly output formats allow programmatic consumers to handle individual events; shared mutable directories can corrupt outputs even when prompts are correct.
D:Headless command-line invocation can run a prompt and return consumable output under controlled settings; this cannot substitute for the behavior that machine-friendly output formats allow programmatic consumers to handle individual events, because CI still needs noninteractive credentials and appropriately limited permissions.
Question 34
A user-defined search tool must query a private backend after Claude proposes structured arguments. What is the most suitable pattern?
- Read the returned tool_use ID and name
- Report tool failures explicitly
- Validate and execute the tool outside the model
- Use an Anthropic server-executed tool where supported
Explanation
Correct Answer
C:Application code enforces permission checks and performs the actual side effect or read; a crucial qualification is that the presence of tool_use content is not evidence the backend was queried.
Incorrect Answers
A:Each client tool request includes metadata that ties subsequent execution and results to that call; this addresses a separate concern, not the fact that application code enforces permission checks and performs the actual side effect or read; guessing an operation from nearby text can dispatch the wrong function.
B:A structured error result communicates the failed operation and supports safe recovery; here, the controlling capability is that application code enforces permission checks and performs the actual side effect or read, but silently replacing an error with an empty success encourages false completion claims.
D:Server tools execute on the service side and return associated results during the model interaction; by comparison, the intended solution relies on this: application code enforces permission checks and performs the actual side effect or read; they have distinct data and capability boundaries from the customer's custom functions.
Question 35
A customer-visible outage recurred because teams only restarted failed workers. How should the implementation handle this need?
- Write a design review before implementation
- Review post-incident root causes
- Categorize and triage production incidents
- Use backward-compatible interface evolution
Explanation
Correct Answer
B:Root-cause analysis traces initiating conditions and systemic prevention beyond short-term restoration; its operational boundary is that a successful restart does not explain why the same fault reappears.
Incorrect Answers
A:Architecture review assesses interfaces, failure modes, and control ownership before code changes; this cannot substitute for the behavior that root-cause analysis traces initiating conditions and systemic prevention beyond short-term restoration, because implementing immediately can lock in unsafe assumptions and costly redesign.
C:Incident classification routes problems to the correct service, integration, or prompt team; this addresses a separate concern, not the fact that root-cause analysis traces initiating conditions and systemic prevention beyond short-term restoration; treating every failure as bad model reasoning conceals infrastructure issues.
D:Additive changes and versioned contracts allow old and new clients to coexist during migration; here, the controlling capability is that root-cause analysis traces initiating conditions and systemic prevention beyond short-term restoration, but an abrupt breaking rename can strand clients even if the model prompt is unchanged.
Question 36
A coding agent must not execute shell commands matching an organization-defined destructive pattern. Which implementation mechanism is needed?
- Use a post-tool hook for outcome auditing
- Inspect outputs before taking business actions
- Use tool allowlists as a baseline defense
- Use a pre-tool hook for prohibited actions
Explanation
Correct Answer
D:A pre-execution hook can inspect and block the operation before it reaches the shell; its operational boundary is that the hook runs outside the model's judgment, but its own policy must be correctly implemented.
Incorrect Answers
A:A lifecycle hook can capture sanitized execution results and support monitoring or follow-up checks; however, the critical mechanism here is that a pre-execution hook can inspect and block the operation before it reaches the shell, and a post-action hook cannot retroactively prevent a harmful command that already ran.
B:Output checks validate schema, scope, and safety before any backend mutation; the requirement instead turns on this behavior: a pre-execution hook can inspect and block the operation before it reaches the shell; post-generation checks cannot repair unauthorized access already performed upstream.
C:Tool availability and credential permissions restrict the reachable attack surface by design; this cannot substitute for the behavior that a pre-execution hook can inspect and block the operation before it reaches the shell, because hooks are additional safeguards, not replacements for minimizing available power.
Question 37
A request includes many small checkpoints that complicate cache behavior without providing meaningful reuse. Which implementation mechanism is needed?
- Remove unnecessary cache breakpoints
- Compare cache TTL with request arrival pattern
- Set output length limits by business task
- Read cache diagnostics when hit rate falls
Explanation
Correct Answer
A:Simpler eligible breakpoint design reduces confusion and aligns with documented limits; notably, arbitrary markers cannot create savings if prefixes keep changing.
Incorrect Answers
B:Lifetime selection must account for actual reuse frequency and write overhead; in contrast, simpler eligible breakpoint design reduces confusion and aligns with documented limits, while a longer cache is not automatically economical for rarely repeated prompts.
C:A tight validated output contract avoids unnecessary generated tokens; this addresses a separate concern, not the fact that simpler eligible breakpoint design reduces confusion and aligns with documented limits; limits must remain sufficient for required fields or responses will truncate.
D:Cache usage metrics and prefix comparisons reveal the changed content causing misses; here, the controlling capability is that simpler eligible breakpoint design reduces confusion and aligns with documented limits, but increasing the context window will not restore a mismatched cache prefix.
Question 38
A summarizer must cap the number of tokens the model is allowed to generate in one response. Which change would satisfy the constraint?
- Continue after max_tokens when appropriate
- Supply alternating conversation turns in messages
- Set an explicit max_tokens budget
- Use the top-level system instruction field
Explanation
Correct Answer
C:The request parameter limits output generation independently from the size of the prompt; a larger max_tokens value does not expand the model's input context window.
Incorrect Answers
A:The application treats a truncated completion differently from an intentional end and safely continues if possible; the missing capability is more specific: the request parameter limits output generation independently from the size of the prompt; delivering a partial JSON document as complete would break downstream parsing.
B:Request messages carry explicit user and assistant roles because the API does not automatically retain prior chat state; by comparison, the intended solution relies on this: the request parameter limits output generation independently from the size of the prompt; omitting history makes follow-up references ambiguous unless reintroduced elsewhere.
D:The Messages API represents governing instructions at request level rather than as a fabricated system role in messages, whereas the requirement calls for another behavior: the request parameter limits output generation independently from the size of the prompt; treating a system instruction as untrusted user content can blur instruction precedence.
Question 39
A research product must let readers verify each externally grounded claim in the supplied documents. What would best address the stated failure mode?
- Define accessible error and refusal behavior
- Define fallback behavior under model outage
- Specify audit and observability needs
- Specify source attribution for factual answers
Explanation
Correct Answer
D:Product requirements describe links or identifiers for supporting evidence and how claims map to sources; notably, requiring a confident tone does not establish provenance.
Incorrect Answers
A:Usability criteria describe understandable errors, alternatives, and escalation paths, whereas the requirement calls for another behavior: product requirements describe links or identifiers for supporting evidence and how claims map to sources; returning an empty model response leaves users unable to diagnose or recover.
B:Availability requirements identify queueing, safe degraded responses, and recovery after service restoration; however, the critical mechanism here is that product requirements describe links or identifiers for supporting evidence and how claims map to sources, and blindly waiting for an API call does not guarantee a usable service.
C:Trace requirements define correlation IDs, redaction rules, event retention, and source attribution; the requirement instead turns on this behavior: product requirements describe links or identifiers for supporting evidence and how claims map to sources; a final natural-language answer is insufficient forensic evidence by itself.
Question 40
Several thousand requests use identical policy rules followed by unique customer questions. What should the team do at this decision point?
- Compare cache TTL with request arrival pattern
- Move unchanged long instructions into a shared prefix
- Remove unnecessary cache breakpoints
- Compute cost from input and output token usage
Explanation
Correct Answer
B:Stable prefix design allows eligible prompt caching to amortize repeated input processing; a crucial qualification is that putting request-specific content before a cache checkpoint defeats reuse.
Incorrect Answers
A:Lifetime selection must account for actual reuse frequency and write overhead; here, the controlling capability is that stable prefix design allows eligible prompt caching to amortize repeated input processing, but a longer cache is not automatically economical for rarely repeated prompts.
C:Simpler eligible breakpoint design reduces confusion and aligns with documented limits; by comparison, the intended solution relies on this: stable prefix design allows eligible prompt caching to amortize repeated input processing; arbitrary markers cannot create savings if prefixes keep changing.
D:Per-model input and output token rates combine with measured usage for accurate costing; the needed capability is different—stable prefix design allows eligible prompt caching to amortize repeated input processing—and number of messages alone is not an adequate unit of resource consumption.