Question 40
A resumed task appears to have applied a payment operation before the session was interrupted. What recovery step is safest?
- Recheck time-sensitive evidence before continuing the resumed workflow
- Reconcile the persisted operation ID against the payment system before retrying
- Sequence state-changing updates or use optimistic concurrency on the session
- Branch from the same validated baseline and keep branch histories separate
Explanation
Correct Answer
B:A durable transcript does not guarantee whether the external effect committed. Idempotent reconciliation prevents double-processing during session recovery.
Incorrect Answers
A:Because session retention preserves past context, not the current truth of external systems, the measure supports refreshing stale evidence during resume rather than the needed reconciling external actions after session interruption.
C:Concurrent writes can produce lost updates and inconsistent tool state; supporting preventing concurrent session-state conflicts cannot replace the required reconciling external actions after session interruption.
D:A common starting context makes alternatives comparable; this contributes to comparing alternatives from a common session baseline without meeting the need for reconciling external actions after session interruption.
Question 41
A code-review agent stops with max_tokens and an obviously unfinished JSON report. How should its controller interpret that response?
- Maintain the tool implementation in the authorized execution environment
- Treat the output as truncated and continue or retry with an adequate token budget
- Match each tool_result with the actual tool_use_id that created it
- Interpret the custom stopping sequence as a generation boundary and validate task completion separately
- Retain the assistant tool_use content block as part of the message history
Explanation
Correct Answer
B:A max_tokens stop means the generation reached the response budget, not that the report passed validation. The controller should avoid publishing an incomplete artifact and handle continuation deliberately.
Incorrect Answers
A:Client tools are interfaces advertised to the model; the hosting application runs their operations; a method suited to distinguishing model intent from tool execution does not meet the need for detecting token-limit truncation.
C:Tool-result correlation is by the invocation identifier, not merely by a shared tool name; that may serve correlating tool responses by invocation, but it is no substitute for detecting token-limit truncation.
D:A stop_sequence signals an application-specified token sequence caused termination; this may support separating custom stop boundaries from success but cannot alone meet the requirement for detecting token-limit truncation.
E:The next request needs the structured assistant invocation and the matching tool result in a coherent transcript; the stated problem requires detecting token-limit truncation rather than preserving the structured conversation transcript.
Question 42
A generated fix changes a public API. What verification must accompany syntax-level success?
- Favor the smallest clear change that meets requirements and preserves interfaces
- Focus on analyzing the root cause before attempting another identical patch
- Run contract or compatibility tests for existing consumers
- Check behavioral acceptance cases rather than treating lint success as completion
- Obtain reproduction inputs and compare observed environment differences first
Explanation
Correct Answer
C:Code that compiles can still break callers relying on prior inputs or outputs. Contract tests check the externally visible behavior that matters in the change.
Incorrect Answers
A:Simplicity is an engineering constraint: extra layers need a demonstrated benefit; the deciding condition is testing API compatibility after code generation, whereas this action concerns reviewing unnecessary complexity in generated code.
B:Repeated unmodified retries do not add evidence; the option would serve escaping a repetitive unsuccessful repair loop, not testing API compatibility after code generation as specified in the stem.
D:Linting checks style and some static issues; it does not prove runtime correctness; that relates to distinguishing static hygiene from functional success, not the necessary testing API compatibility after code generation.
E:Although without a reproducible failure or causal evidence, broad edits are speculative, the choice addresses establishing a reliable bug reproduction and not the requested testing API compatibility after code generation.
Question 43
A system gives a worker a vague goal to handle the entire issue without any stop conditions. What decomposition fix helps?
- Focus on dividing inputs into independent batches with stable document IDs
- Combine closely related low-cost tasks into a meaningful worker assignment
- Split the issue into bounded states with explicit exit and escalation criteria
- Choose direct deterministic lookup and rule evaluation for the simple stages
Explanation
Correct Answer
C:Bounded tasks define what evidence and action terminate work. An open-ended instruction can lead to unproductive loops and unclear human handoff.
Incorrect Answers
A:When addressing partitioning bulk documents into traceable units, independent document chunks can run concurrently and recover separately; the present task instead calls for defining bounded task exits.
B:Excessive decomposition multiplies setup and context cost; avoiding overfragmentation of delegated work and defining bounded task exits require different controls in this situation.
D:Not every step requires another model or subagent; in this scenario, separating deterministic steps from inference is secondary to defining bounded task exits.
Question 44
An invoice pipeline breaks whenever the model returns a Markdown code fence around JSON. What API feature most directly enforces parseable structure?
- Specify the tool input schema with a numeric amount field and strict validation where supported
- Represent line items as an array with a defined item object schema
- Request schema-constrained JSON output through the supported structured-output interface
- Choose a finite enumeration for the allowed status values
Explanation
Correct Answer
C:Constrained JSON generation can enforce a declared schema for supported responses, avoiding brittle scraping of prose or fences. Business-field correctness still requires separate checks.
Incorrect Answers
A:Typed schema constraints differentiate numeric amounts from text; this can serve enforcing typed arguments for a tool call, but leaves the requirement for producing machine-parseable schema-conformant JSON unmet.
B:The declared array type tells the consumer how to iterate through repeated records; that addresses constraining collection shape in extraction output, whereas this case calls for producing machine-parseable schema-conformant JSON.
D:Enumerated values constrain the output vocabulary and simplify downstream branching; restricting status output to known categories and producing machine-parseable schema-conformant JSON are distinct responsibilities under these constraints.
Question 45
An incident response agent sees two contradictory policy articles with the same apparent status. What should it do?
- Request authorized identity clarification before account-specific action
- Refer to the security or fraud workflow and suspend sensitive actions
- Supply a concise structured handoff with issue, evidence, attempted steps and decision needed
- Request policy-owner resolution before applying either disputed instruction
- Record the exception rationale and route it through the authorized review process
Explanation
Correct Answer
D:Conflicting authoritative sources create genuine uncertainty. Silently choosing the more convenient rule could cause inconsistent or noncompliant outcomes.
Incorrect Answers
A:Missing identity is a safety-critical ambiguity; supporting escalating unresolved customer identity cannot replace the required escalating conflicting governing policies.
B:Fraud indicators change the permitted handling of customer accounts; this contributes to routing suspected fraud out of standard support without meeting the need for escalating conflicting governing policies.
C:Structured escalations let the human act on the actual unresolved choice; that serves preparing an actionable human escalation, whereas the case requires escalating conflicting governing policies.
E:Unusual circumstances may justify discretion but need a human or policy-sanctioned decision; its benefits for processing policy exceptions through approval do not resolve the need for escalating conflicting governing policies.
Question 46
A multi-step agent needs to call an external tool only after a human accepts its proposed change. Which control establishes this?
- Insert a human approval gate between proposal and execution
- Choose a fail-closed publication decision on missing mandatory evidence
- Prioritize making eligibility verification a required predecessor in the workflow graph
- Include a concise case summary, relevant evidence and the escalation reason
Explanation
Correct Answer
A:Human-in-the-loop approval must be enforced by the controller for side effects. The model's promise to wait is not itself an authorization barrier.
Incorrect Answers
B:If a required validation fails, the pipeline should report incomplete work rather than produce a polished but unsupported artifact; this may support failing closed on an unmet evidence requirement but cannot alone meet the requirement for inserting human approval before side effects.
C:An explicit dependency ensures the mutation cannot begin before policy checks succeed; the stated problem requires inserting human approval before side effects rather than enforcing refund prerequisites before mutation.
D:A meaningful handoff preserves the context the reviewer needs to act, avoiding repeated questioning and incorrect policy decisions; a method suited to transferring sufficient escalation context does not meet the need for inserting human approval before side effects.
Question 47
A developer manually rewrites the same architecture-decision record template in every chat. What artifact would standardize it?
- Save the skill at project scope rather than globally for the user
- Bundle the release workflow as a project skill with clear instructions
- Specify a custom slash-invocable command or skill for the PR summary
- Create a project skill containing the ADR template and review criteria
Explanation
Correct Answer
D:A skill can provide consistent document structure and decision checkpoints. Keeping the template in one place makes later governance and revision easier.
Incorrect Answers
A:Scope limits where reusable workflows are discovered and available; this addresses limiting a sensitive skill to its repository, while the question is about reusing a controlled architecture-record template.
B:A reusable skill can collect steps, supporting files and tool permissions under one invocable workflow; that relates to making a repeatable release workflow reusable, not the necessary reusing a controlled architecture-record template.
C:Although named command workflows provide repeatable behavior for a familiar task, the choice addresses creating a reusable named PR-summary action and not the requested reusing a controlled architecture-record template.
Question 48
A company has strict policy that must apply regardless of which files the agent touches. Should it be kept only in a path-conditioned rule?
- Specify path-scoped rules under .claude/rules with file-pattern applicability
- Narrow the rule's paths glob to target only migration files
- Relocate conditional package conventions into dedicated rules files with path selectors
- Place globally applicable policy in an always-loaded or enforced layer
Explanation
Correct Answer
D:A conditional file rule may not activate in every session. Mandatory organization constraints need a reliable broader scope and, where critical, executable enforcement.
Incorrect Answers
A:Path-conditioned repository guidance applies specialized instructions only to matching files; the unsatisfied requirement is keeping organization-wide policy outside conditional globs, not applying code-style rules by path.
B:A narrower glob controls the rule's applicability; in this scenario, narrowing a conditional rule's file scope is secondary to keeping organization-wide policy outside conditional globs.
C:When considering avoiding an oversized global project rule set, splitting the corpus by applicability reduces irrelevant context; the requirement for keeping organization-wide policy outside conditional globs remains unmet.
Question 49
A tool call fails and the agent fills the missing data using its prior knowledge. What should error-handling policy require?
- Check the worker's claimed completion against authoritative tool status
- Separate tool failure from a valid search with zero matches
- Monitor a partial workflow outcome and identify the unavailable branch explicitly
- Verify the external operation using an idempotency identifier before replay
- Record the evidence gap and either retry safely or abstain from the unsupported claim
Explanation
Correct Answer
E:Failed retrieval does not authorize fabricating authoritative state. Error-aware output must preserve uncertainty until valid evidence becomes available.
Incorrect Answers
A:Subagent prose should not override an explicit failed execution record; this concerns verifying delegated completion against real error state, leaving the requirement for preventing fabricated facts after upstream errors outstanding.
B:Infrastructure errors must propagate as errors, not negative evidence; propagating search errors without treating them as no-match evidence and preventing fabricated facts after upstream errors are distinct responsibilities under these constraints.
C:Partial success is not whole-task success; the action supports preserving partial-failure status across worker aggregation but falls short of preventing fabricated facts after upstream errors in this case.
D:Distributed errors may arrive after a side effect has occurred; this can serve preventing duplicate side effects in retrying workers, but leaves the requirement for preventing fabricated facts after upstream errors unmet.
Question 50
A system requires structured extraction but sometimes receives a model refusal. What should its parser account for?
- Choose nested object definitions with typed address properties
- Reduce the schema to supported constructs and validate remaining rules in application code
- Track versions of the result contract and test consumers before deploying schema changes
- Detect nonstandard stop or refusal outcomes before treating content as a schema result
Explanation
Correct Answer
D:Schema-oriented APIs may have special refusal or termination paths. Robust consumers inspect response status instead of assuming every completion is a usable record.
Incorrect Answers
A:A nested schema preserves structural relationships and makes each field independently verifiable; that serves constraining nested JSON extraction structures, whereas the case requires handling non-result terminations in structured workflows.
B:Because constrained decoding has a documented supported JSON Schema subset, the measure supports respecting structured-output schema limitations rather than the needed handling non-result terminations in structured workflows.
C:Structured outputs create a stable interface that downstream systems depend upon; its benefits for managing downstream compatibility of structured outputs do not resolve the need for handling non-result terminations in structured workflows.