Question 510
A synchronous title generator takes a supplied text snippet and needs no tool execution or planning. What is the correct engineering decision?
- Use a basic Messages API call
- Use the Claude Agent SDK
- Build a custom Messages API loop
- Stop the loop on end_turn
Explanation
Correct Answer
A:A single request produces the completion without a persistent orchestration loop, subject to this requirement: adding agent scaffolding increases latency for a task with no external actions.
Incorrect Answers
B:The SDK provides higher-level agent controls and integrations while the application supplies policies and oversight; here, the controlling capability is that a single request produces the completion without a persistent orchestration loop, but prebuilt orchestration does not remove responsibility for secrets and tool permission boundaries.
C:A developer-managed loop explicitly handles tool_use, executes tools, returns tool_result, and continues as needed; the missing capability is more specific: a single request produces the completion without a persistent orchestration loop; every error, retry, and termination branch must be implemented by the application.
D:The harness treats the completion reason as the signal to deliver the final answer and exit; by comparison, the intended solution relies on this: a single request produces the completion without a persistent orchestration loop; repeating requests after natural completion can create unnecessary tool cycles.
Question 511
Before commands run, policy requires an automated check that the targets are not protected production paths. Which engineering practice is the strongest match?
- Use a hook for mandatory pre-execution validation
- Use a sandbox for model-requested code execution
- Use a custom command for a repeated invocation
- Create a project Skill for recurring checks
Explanation
Correct Answer
A:A lifecycle hook evaluates the proposed action outside the model and can block it deterministically; in production, natural-language checklists are weaker than enforced execution controls.
Incorrect Answers
B:Process and network isolation contain potential side effects of generated programs; the needed capability is different—a lifecycle hook evaluates the proposed action outside the model and can block it deterministically—and a model's internal safety judgment is not an OS permission boundary.
C:A command encapsulates a recognizable workflow entry point for interactive coding sessions, whereas the requirement calls for another behavior: a lifecycle hook evaluates the proposed action outside the model and can block it deterministically; it does not create a new callable external service by itself.
D:Skill content packages reusable instructions and supporting guidance for the task; however, the critical mechanism here is that a lifecycle hook evaluates the proposed action outside the model and can block it deterministically, and the project must still provide actual tests and tools needed to perform the checks.
Question 512
A classification controls legal workflow deadlines but evidence is inconsistent across documents. What would best address the stated failure mode?
- Escalate low-confidence high-impact cases
- Parse generated JSON with a real parser
- Cross-check numerical fields with deterministic logic
- Include source spans for extracted values
Explanation
Correct Answer
A:Risk-based human review catches consequential uncertain outputs before automatic action; in production, automatic acceptance based on polished prose could cause compliance failures.
Incorrect Answers
B:Standard JSON parsing catches syntactic errors instead of relying on visual plausibility; the needed capability is different—risk-based human review catches consequential uncertain outputs before automatic action—and successfully parsed JSON can still violate expected business types.
C:Code verifies arithmetic consistency after the model proposes the values, whereas the requirement calls for another behavior: risk-based human review catches consequential uncertain outputs before automatic action; model confidence does not establish accounting correctness.
D:Provenance fields or offsets let reviewers inspect the original supporting text; however, the critical mechanism here is that risk-based human review catches consequential uncertain outputs before automatic action, and a fluent explanation without a source is not independently verifiable.
Question 513
An automation discovers that the target repository is inaccessible despite an initial plan to analyze it. How should this requirement be met?
- Build a task plan with measurable completion criteria
- Revise the plan after a failed prerequisite
- Retry a failed read with bounded backoff
- Use checkpointed milestones
Explanation
Correct Answer
B:The agent re-evaluates dependencies and selects a safe next step based on the observed failure; the implementation must still recognize that it should not bypass authorization or invent missing file contents.
Incorrect Answers
A:A plan with explicit deliverables and stop checks makes progress and completion observable; this addresses a separate concern, not the fact that the agent re-evaluates dependencies and selects a safe next step based on the observed failure; planning quality does not replace runtime controls on tools and duration.
C:Retrying after increasing delays can recover a transient read failure without changing external state; the missing capability is more specific: the agent re-evaluates dependencies and selects a safe next step based on the observed failure; the caller must stop after a limited number of attempts and surface persistent failure.
D:Milestone artifacts preserve progress and support a safe resume after transient interruptions; by comparison, the intended solution relies on this: the agent re-evaluates dependencies and selects a safe next step based on the observed failure; checkpoints must be consistent with any external actions already committed.
Question 514
The model sends a long response in fragments that must be assembled into one displayable answer. Which option best fits the described workflow?
- Aggregate content_block_delta events
- Handle ping events without treating them as content
- Parse typed content blocks rather than raw concatenation
- Use message_stop as a stream completion signal
Explanation
Correct Answer
A:Deltas update the current content block until its corresponding stop event arrives; its operational boundary is that individual fragments are not complete JSON messages or guaranteed sentence boundaries.
Incorrect Answers
B:Ping events maintain connectivity but do not represent assistant text to display; this addresses a separate concern, not the fact that deltas update the current content block until its corresponding stop event arrives; showing keepalives as answer content would corrupt the rendered response.
C:Typed block handling preserves whether an element is displayable text or a tool request; here, the controlling capability is that deltas update the current content block until its corresponding stop event arrives, but blindly concatenating heterogeneous blocks can lose tool metadata and semantics.
D:The terminal event marks completion of the streamed message lifecycle; the missing capability is more specific: deltas update the current content block until its corresponding stop event arrives; a ping or an individual content-block stop does not mean the entire response ended.
Question 515
A chat product handles sensitive conversations that should expire under corporate policy. What is the appropriate next design choice?
- Use transaction controls for critical writes
- Minimize personal fields before inference
- Apply retention and deletion rules to transcripts
- Authorize access to stored conversation history
Explanation
Correct Answer
C:Storage controls govern how long records, logs, and derived artifacts remain available; its operational boundary is that a model's context window does not define legal data retention requirements.
Incorrect Answers
A:Atomic transactions or compensating workflows preserve business consistency across approved changes; the requirement instead turns on this behavior: storage controls govern how long records, logs, and derived artifacts remain available; model reasoning does not guarantee database rollback.
B:Data minimization removes unrelated personal information prior to sending content to the model; this cannot substitute for the behavior that storage controls govern how long records, logs, and derived artifacts remain available, because a request to disregard a field still exposes that field if it is transmitted.
D:Access-control checks at the storage layer prevent cross-account conversation disclosure; this addresses a separate concern, not the fact that storage controls govern how long records, logs, and derived artifacts remain available; a hidden session identifier is not enough to authorize retrieval.
Question 516
A tool can query records but is not supposed to edit anything in the connected service. Which of these alternatives serves the stated goal?
- Sandbox uncertain code execution
- Monitor and investigate unusual tool activity
- Perform a least-privilege permissions review
- Enforce least-privilege infrastructure permissions
Explanation
Correct Answer
D:Backend credentials and IAM policies restrict it to the minimum necessary operations; a crucial qualification is that an unrestricted credential remains dangerous regardless of the model's stated intent.
Incorrect Answers
A:Runtime isolation limits privileges, file access, and network effects of untrusted programs; in contrast, backend credentials and IAM policies restrict it to the minimum necessary operations, while static text review cannot guarantee the code will behave safely.
B:Telemetry and alerts identify suspicious action patterns and allow prompt, tool, or policy remediation; this addresses a separate concern, not the fact that backend credentials and IAM policies restrict it to the minimum necessary operations; monitoring should complement, not replace, preventive execution controls.
C:Reviewing actual credentials and granted scopes shrinks the impact of a compromised prompt or tool; here, the controlling capability is that backend credentials and IAM policies restrict it to the minimum necessary operations, but the prompt's intended task does not limit the external credential automatically.
Question 517
A new SDK causes intermittent parsing failures after deployment to production. What is the right implementation response?
- Retain a tested rollback version
- Record prompt version in traces
- Link commits to deployed build artifacts
- Audit configuration changes
Explanation
Correct Answer
A:Keeping the previously tested artifact enables a measured rollback when safe, subject to this requirement: a rollback should consider state migrations and outstanding jobs.
Incorrect Answers
B:Trace metadata connects outcomes to the actual deployed instruction set; here, the controlling capability is that keeping the previously tested artifact enables a measured rollback when safe, but a model name by itself does not explain prompt-specific behavior changes.
C:Immutable artifact identifiers connect deployment state to reviewed source revisions; the missing capability is more specific: keeping the previously tested artifact enables a measured rollback when safe; a human-readable release label alone may not uniquely identify deployed bytes.
D:Change logs capture approvals, diffs, and rollout outcomes for accountable administration; by comparison, the intended solution relies on this: keeping the previously tested artifact enables a measured rollback when safe; a chat transcript is not a complete record of production configuration edits.
Question 518
Five API call sites each implement different backoff behavior and produce inconsistent outages. Which production safeguard is most relevant?
- Remove dead configuration flags after verification
- Introduce typed domain models
- Centralize retry policy in shared middleware
- Retry only failures considered transient
Explanation
Correct Answer
C:Shared policy consistently classifies errors and applies bounded retries across services; the important constraint is that it must still allow endpoint-specific rules for unsafe side effects.
Incorrect Answers
A:Evidence of unused paths plus regression tests permit safe cleanup of obsolete logic; the needed capability is different—shared policy consistently classifies errors and applies bounded retries across services—and deleting unknown switches without checking deployments can cause hidden failures.
B:Explicit types and validation prevent accidental incompatible assumptions at module boundaries, whereas the requirement calls for another behavior: shared policy consistently classifies errors and applies bounded retries across services; types cannot establish that an order actually belongs to the authorized user.
D:A retry policy classifies failure causes and retries only the recoverable subset; the requirement instead turns on this behavior: shared policy consistently classifies errors and applies bounded retries across services; repeating all failures indiscriminately can amplify outages and costs.
Question 519
A backend receives a structured response and must reject missing or incorrectly typed values. What would best address the stated failure mode?
- Use a raw HTTPS REST client when necessary
- Preserve UTF-8 content safely
- Encode JSON using a proper serializer
- Deserialize JSON with expected schema checks
Explanation
Correct Answer
D:Typed validation enforces the documented contract after parsing, subject to this requirement: JSON syntax validity does not prove field meaning or user authorization.
Incorrect Answers
A:Direct REST requests can call the same documented endpoint with correct headers and body; the requirement instead turns on this behavior: typed validation enforces the documented contract after parsing; the developer must implement encoding, retries, and response parsing independently.
B:Proper encoding preserves characters consistently between client, API, and storage; this cannot substitute for the behavior that typed validation enforces the documented contract after parsing, because re-encoding bytes as the wrong character set can corrupt meaning.
C:A JSON encoder produces correctly escaped structured payloads; in contrast, typed validation enforces the documented contract after parsing, while manually concatenated JSON strings are vulnerable to malformed syntax and injection bugs.
Question 520
A client needs a reliable template for summarizing a policy document published by a reusable MCP server. Which approach targets the deciding condition?
- Combine a guarded custom tool with a human approval step
- Combine a deterministic hook with a coding agent
- Combine MCP resources with a summarization prompt
- Use an MCP server for a reusable integration
Explanation
Correct Answer
C:Resources supply source data while a prompt governs how it should be analyzed, although neither component independently guarantees the summary is factually faithful.
Incorrect Answers
A:The tool executes a constrained operation after an enforced business approval gate; by comparison, the intended solution relies on this: resources supply source data while a prompt governs how it should be analyzed; model-generated consent text is not an auditable approval event.
B:A hook enforces the external check while the model handles the flexible development task; the needed capability is different—resources supply source data while a prompt governs how it should be analyzed—and without correct hook wiring and tool permissions, guidance alone is insufficient.
D:A protocol server exposes shared tools and resources with consistent discovery semantics; however, the critical mechanism here is that resources supply source data while a prompt governs how it should be analyzed, and it adds infrastructure and identity concerns compared with a single local function.