Question 280
Two acceptance tests block a production inference application: one requires the ability to reuse a long stable instruction or document prefix over repeated requests; the other requires the ability to enforce a caller-defined textual boundary on generation. Which plan clears both tests?
- Perform both steps: (1) Cache an eligible unchanged prefix with cache_control; (2) submit independent requests through the message batches api.
- Perform both steps: (1) Branch on stop_reason tool_use and dispatch the declared calls; (2) submit independent requests through the message batches api.
- Perform both steps: (1) Cache an eligible unchanged prefix with cache_control; (2) use stop_sequences and inspect the returned stop_sequence field.
- Perform both steps: (1) Branch on stop_reason tool_use and dispatch the declared calls; (2) use stop_sequences and inspect the returned stop_sequence field.
Explanation
Correct Answer
C:The first change enables the team to reuse a long stable instruction or document prefix over repeated requests because prompt caching reduces repeated input processing when the prefix matches; changes before the cache boundary can prevent a hit; the second addresses the separate need to enforce a caller-defined textual boundary on generation because a stop sequence halts generation at a specified marker, distinct from natural completion and separate from a JSON schema validator.
Incorrect Answers
A:The first step is appropriate for the requirement to reuse a long stable instruction or document prefix over repeated requests because prompt caching reduces repeated input processing when the prefix matches; changes before the cache boundary can prevent a hit; the other step instead aims to process a large queue of independent, noninteractive requests at a lower-cost asynchronous pace because batch processing is suited to deferred work with eventual result collection and is not a substitute for an interactive low-latency chat endpoint, which does not meet the second requirement to enforce a caller-defined textual boundary on generation.
B:Both steps target different results—recognize that the model is asking the application to execute a client tool and process a large queue of independent, noninteractive requests at a lower-cost asynchronous pace—because a tool-use stop requires host-side handling and a follow-up message containing results, not presenting the call as final prose and batch processing is suited to deferred work with eventual result collection and is not a substitute for an interactive low-latency chat endpoint; the required capabilities are instead to reuse a long stable instruction or document prefix over repeated requests and to enforce a caller-defined textual boundary on generation.
D:The second step meets the requirement to enforce a caller-defined textual boundary on generation because a stop sequence halts generation at a specified marker, distinct from natural completion and separate from a JSON schema validator; the first step would only help to recognize that the model is asking the application to execute a client tool because a tool-use stop requires host-side handling and a follow-up message containing results, not presenting the call as final prose, leaving the separate requirement to reuse a long stable instruction or document prefix over repeated requests unmet.
Question 281
While planning a long-context summarization workflow, the product owner specifies that it must leave space for a model to generate a complete answer after adding source documents. Which solution fulfills the requirement?
- Require a completed stop condition before accepting the parsed result.
- Map or reject values not in the approved enumeration.
- Summarize prior decisions and preserve unresolved constraints.
- Reserve an output budget while enforcing input-context limits.
Explanation
Correct Answer
D:To leave space for a model to generate a complete answer after adding source documents in this long-context summarization workflow, input instructions, history, and evidence share the overall model capacity with generation, so filling it entirely can truncate output; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to avoid processing a truncated structured response as a complete record because a response cut off by token limits may parse incompletely or omit required content; completion status matters in addition to syntax; that mechanism does not meet the different requirement to leave space for a model to generate a complete answer after adding source documents.
B:The proposed alternative helps to prevent a generated status outside a database's accepted code set because controlled vocabularies need explicit allowed values; a plausible new status label can still break downstream contracts; that mechanism does not meet the different requirement to leave space for a model to generate a complete answer after adding source documents.
C:The proposed alternative helps to maintain the current task after older dialogue exceeds the active token budget because a faithful rolling summary carries forward objectives and commitments while avoiding a full-history replay on each call; that mechanism does not meet the different requirement to leave space for a model to generate a complete answer after adding source documents.
Question 282
In a Claude inference cost review, a release requirement is to stop a no-longer-needed inference when the user's request is cancelled. Which implementation addresses that specific requirement?
- Use a WebSocket protocol only when the target endpoint actually offers one.
- Serialize the documented nested request shape rather than flattening it.
- Iterate the SDK or HTTP event stream until its terminal event.
- Propagate cancellation to the active network request when supported.
Explanation
Correct Answer
D:To stop a no-longer-needed inference when the user's request is cancelled in this Claude inference cost review, cancelling work can free local resources and avoid processing obsolete results, though already-incurred provider work may still be billed; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to build bidirectional persistent event communication where the chosen platform supports it because webSockets can carry two-way events over a long-lived connection; they are not a drop-in replacement for every HTTP or SSE endpoint; that mechanism does not meet the different requirement to stop a no-longer-needed inference when the user's request is cancelled.
B:The proposed alternative helps to preserve arrays of typed content blocks when sending multimodal input because typed content and role fields carry protocol meaning that is lost if developers simply concatenate them into plain text; that mechanism does not meet the different requirement to stop a no-longer-needed inference when the user's request is cancelled.
C:The proposed alternative helps to process partial model output as it is delivered over a streaming connection because streaming clients must handle both content deltas and final status rather than assuming the first chunk is the complete response; that mechanism does not meet the different requirement to stop a no-longer-needed inference when the user's request is cancelled.
Question 283
The team responsible for a hosted document-processing service needs to shield customer traffic when inference capacity is exhausted. What is the most direct engineering change?
- Queue or reject excess requests using bounded admission control.
- Persist explicit job states with allowed transitions.
- Apply a context retention policy and summarize earlier turns where suitable.
- Buffer structured data until it can be parsed and validated before UI commit.
Explanation
Correct Answer
A:To shield customer traffic when inference capacity is exhausted in this hosted document-processing service, controlled queuing protects system latency and prevents unbounded retries from overwhelming downstream provider quotas; the proposed implementation directly supplies that capability.
Incorrect Answers
B:The proposed alternative helps to distinguish queued, running, waiting-for-approval, failed, and completed agent jobs because a state machine prevents an incomplete tool operation from being shown as successful and makes retries and cancellation predictable; that mechanism does not meet the different requirement to shield customer traffic when inference capacity is exhausted.
C:The proposed alternative helps to stay within input limits while keeping the most important conversation constraints because selective history management preserves task-critical state; dropping random leading messages can erase consent or requirements; that mechanism does not meet the different requirement to shield customer traffic when inference capacity is exhausted.
D:The proposed alternative helps to display partial sentences without publishing malformed structured records because a text stream can arrive in fragments; consumers must distinguish presentation updates from complete machine-readable objects; that mechanism does not meet the different requirement to shield customer traffic when inference capacity is exhausted.
Question 284
A production readiness review of a specialist-agent orchestration service finds that the team cannot yet minimize infrastructure ownership for a supported hosted agent execution surface or impose predictable maximum cost and wall-clock exposure on autonomous execution. Which paired changes directly remedy the two gaps?
- Perform both steps: (1) Evaluate a managed agent runtime against the deployment requirements; (2) apply limits for steps, elapsed time, and token or tool expenditure.
- Perform both steps: (1) Persist and resume the agent session using supported state handling; (2) enforce explicit completion checks and a maximum iteration budget.
- Perform both steps: (1) Persist and resume the agent session using supported state handling; (2) apply limits for steps, elapsed time, and token or tool expenditure.
- Perform both steps: (1) Evaluate a managed agent runtime against the deployment requirements; (2) enforce explicit completion checks and a maximum iteration budget.
Explanation
Correct Answer
A:The first change enables the team to minimize infrastructure ownership for a supported hosted agent execution surface because a managed runtime can take on execution infrastructure, but access controls, product availability, and data-handling needs still require evaluation; the second addresses the separate need to impose predictable maximum cost and wall-clock exposure on autonomous execution because runtime budgets are external constraints on agent activity and must be enforced by the host, not inferred from a cooperative natural-language instruction.
Incorrect Answers
B:Both steps target different results—continue a paused multi-step task with its legitimate prior context and stop iterative tool use when a success condition or resource budget is reached—because session continuity preserves relevant work across invocations; discarding session state can cause repeated tools or lost intermediate decisions and bounded loops avoid unending tool calls and uncontrolled spend while making incomplete work visible instead of silently continuing; the required capabilities are instead to minimize infrastructure ownership for a supported hosted agent execution surface and to impose predictable maximum cost and wall-clock exposure on autonomous execution.
C:The second step meets the requirement to impose predictable maximum cost and wall-clock exposure on autonomous execution because runtime budgets are external constraints on agent activity and must be enforced by the host, not inferred from a cooperative natural-language instruction; the first step would only help to continue a paused multi-step task with its legitimate prior context because session continuity preserves relevant work across invocations; discarding session state can cause repeated tools or lost intermediate decisions, leaving the separate requirement to minimize infrastructure ownership for a supported hosted agent execution surface unmet.
D:The first step is appropriate for the requirement to minimize infrastructure ownership for a supported hosted agent execution surface because a managed runtime can take on execution infrastructure, but access controls, product availability, and data-handling needs still require evaluation; the other step instead aims to stop iterative tool use when a success condition or resource budget is reached because bounded loops avoid unending tool calls and uncontrolled spend while making incomplete work visible instead of silently continuing, which does not meet the second requirement to impose predictable maximum cost and wall-clock exposure on autonomous execution.
Question 285
An operational review of a tool-calling Claude workflow reports distinct failures: it cannot maintain a reusable collection of related integrations and agent instructions across projects, and it cannot invoke a proprietary internal pricing database unavailable through a built-in feature. Which two repairs are required? Choose TWO.
- Return a concise task-relevant projection from the tool handler.
- Configure a supported remote HTTP transport with authentication and deployment controls.
- Package the compatible components as an installable plugin when supported.
- Disable the capability at configuration or tool-registration level.
- Write a custom tool whose handler runs in the application.
Explanation
Correct Answers
C:To maintain a reusable collection of related integrations and agent instructions across projects as part of a design that must also invoke a proprietary internal pricing database unavailable through a built-in feature, a plugin groups capabilities for distribution and configuration; a single direct tool is simpler when packaging and reuse are unnecessary; this is why the action is one of the two required selections.
E:To invoke a proprietary internal pricing database unavailable through a built-in feature as part of a design that must also maintain a reusable collection of related integrations and agent instructions across projects, custom tools expose application-specific actions while retaining control over authentication, validation, and network access; this is why the action is one of the two required selections.
Incorrect Answers
A:This alternative serves the separate goal to reduce context bloat caused by a tool returning a thousand irrelevant fields because tool output is subsequently consumed as model context; minimizing it reduces both token cost and distractions; the required outcomes are instead to maintain a reusable collection of related integrations and agent instructions across projects and to invoke a proprietary internal pricing database unavailable through a built-in feature.
B:This alternative serves the separate goal to expose an MCP server to clients across a network boundary because remote connectivity needs network routing, identity, and authorization; a local stdio subprocess is not a remotely reachable service; the required outcomes are instead to maintain a reusable collection of related integrations and agent instructions across projects and to invoke a proprietary internal pricing database unavailable through a built-in feature.
D:This alternative serves the separate goal to remove an agent's access to an obsolete integration without rewriting all its task prompts because actual registered capabilities define what may execute; changing descriptive prompt text alone does not revoke a previously available tool; the required outcomes are instead to maintain a reusable collection of related integrations and agent instructions across projects and to invoke a proprietary internal pricing database unavailable through a built-in feature.
Question 286
For a Python Claude API backend, the missing capability is to compare candidate models before switching a mission-critical endpoint. What should the developers implement?
- Track enabled plugins and their compatible versions as release dependencies.
- Store prompt versions with release identifiers and rollback history.
- Use asynchronous SDK calls with bounded concurrency.
- Treat model migration as a tested deployment with staged traffic.
Explanation
Correct Answer
D:To compare candidate models before switching a mission-critical endpoint in this Python Claude API backend, model upgrades may alter output distributions or supported features; staged validation reduces the chance of an unnoticed behavior shift; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to avoid a plugin update unexpectedly changing tools available to a coding agent because plugin capability changes can affect tool names and permissions, so production configuration should be reproducible and reviewed; that mechanism does not meet the different requirement to compare candidate models before switching a mission-critical endpoint.
B:The proposed alternative helps to determine whether a quality regression came from a recent instruction edit because a prompt is a behavior-changing artifact; versioning makes comparisons and safe reversions possible during incident response; that mechanism does not meet the different requirement to compare candidate models before switching a mission-critical endpoint.
C:The proposed alternative helps to serve many concurrent network-bound Claude requests without blocking worker threads unnecessarily because async I/O can overlap network waits, but it does not remove provider limits or make CPU-heavy postprocessing nonblocking; that mechanism does not meet the different requirement to compare candidate models before switching a mission-critical endpoint.
Question 287
A design review for a model selection trial asks for support to prevent constantly changing user text from invalidating a reusable prompt prefix, together with a way to choose a cheaper model only when the workload-level economics improve. Select the two appropriate changes. Choose TWO.
- Compare quality-adjusted cost per accepted result across candidate models.
- Evaluate Message Batches instead of synchronous requests.
- Use more exploratory sampling where supported and measure quality.
- Place caching around stable ordered content before dynamic material.
- Propagate cancellation to the active network request when supported.
Explanation
Correct Answers
A:To choose a cheaper model only when the workload-level economics improve as part of a design that must also prevent constantly changing user text from invalidating a reusable prompt prefix, a lower token price can be offset by retries, higher failure rates, or excessive output, so accepted-result cost is the useful measure; this is why the action is one of the two required selections.
D:To prevent constantly changing user text from invalidating a reusable prompt prefix as part of a design that must also choose a cheaper model only when the workload-level economics improve, cache matching operates over the stable prefix, so volatile material before the breakpoint undermines reuse; this is why the action is one of the two required selections.
Incorrect Answers
B:This alternative serves the separate goal to cut cost for a nightly noninteractive summarization workload because asynchronous batches can offer discounted processing when the application can tolerate deferred completion and result collection; the required outcomes are instead to prevent constantly changing user text from invalidating a reusable prompt prefix and to choose a cheaper model only when the workload-level economics improve.
C:This alternative serves the separate goal to invite stylistic variety during noncritical brainstorming because higher sampling randomness broadens candidate phrasing but can reduce predictability, so it suits ideation better than strict extraction; the required outcomes are instead to prevent constantly changing user text from invalidating a reusable prompt prefix and to choose a cheaper model only when the workload-level economics improve.
E:This alternative serves the separate goal to stop a no-longer-needed inference when the user's request is cancelled because cancelling work can free local resources and avoid processing obsolete results, though already-incurred provider work may still be billed; the required outcomes are instead to prevent constantly changing user text from invalidating a reusable prompt prefix and to choose a cheaper model only when the workload-level economics improve.
Question 288
In a context-rich document assistant, a release requirement is to maintain label semantics when a few-shot prompt contains dialogue. Which implementation addresses that specific requirement?
- Specify the forbidden content alongside an enforceable validation check.
- Supply representative labeled examples including edge conditions.
- State the task, audience, scope, and required deliverable explicitly.
- Use properly labeled example inputs and outputs instead of mixing speakers.
Explanation
Correct Answer
D:To maintain label semantics when a few-shot prompt contains dialogue in this context-rich document assistant, correct role boundaries keep demonstrations interpretable and prevent an example answer from looking like a live instruction; the proposed implementation directly supplies that capability.
Incorrect Answers
A:The proposed alternative helps to avoid a prohibited output element such as confidential identifiers because negative prompt guidance signals the intended boundary, but a deterministic validator is needed where violating it has consequences; that mechanism does not meet the different requirement to maintain label semantics when a few-shot prompt contains dialogue.
B:The proposed alternative helps to teach a classifier how to label borderline requests consistently because diverse demonstrations make the intended decision boundary clearer than an isolated easy example, provided labels are accurate; that mechanism does not meet the different requirement to maintain label semantics when a few-shot prompt contains dialogue.
C:The proposed alternative helps to stop a model from alternating unpredictably between summary and extraction because specific task wording narrows reasonable interpretations and gives validation rules a clear target without relying on implied intent; that mechanism does not meet the different requirement to maintain label semantics when a few-shot prompt contains dialogue.
Question 289
The technical owner of a business workflow that calls Claude has to determine whether a quality regression came from a recent instruction edit. A separate requirement is to reproduce production behavior across deploys instead of silently adopting a new model release. Which two-part remediation covers both?
- Perform both steps: (1) Enable required plugin or connector capabilities using least-privilege configuration; (2) pin a supported explicit model version where stability is required.
- Perform both steps: (1) Enable required plugin or connector capabilities using least-privilege configuration; (2) use the user's own claude code settings file.
- Perform both steps: (1) Store prompt versions with release identifiers and rollback history; (2) pin a supported explicit model version where stability is required.
- Perform both steps: (1) Store prompt versions with release identifiers and rollback history; (2) use the user's own claude code settings file.
Explanation
Correct Answer
C:The first change enables the team to determine whether a quality regression came from a recent instruction edit because a prompt is a behavior-changing artifact; versioning makes comparisons and safe reversions possible during incident response; the second addresses the separate need to reproduce production behavior across deploys instead of silently adopting a new model release because explicit version selection limits unexpected changes; a release process should evaluate upgrades and retirement timelines deliberately.
Incorrect Answers
A:The second step meets the requirement to reproduce production behavior across deploys instead of silently adopting a new model release because explicit version selection limits unexpected changes; a release process should evaluate upgrades and retirement timelines deliberately; the first step would only help to expose external business tools only to workflows that actually need them because tools expand the application's action surface; indiscriminate activation increases risk and can confuse model selection among similar functions, leaving the separate requirement to determine whether a quality regression came from a recent instruction edit unmet.
B:Both steps target different results—expose external business tools only to workflows that actually need them and customize one developer's default Claude Code behavior across local projects—because tools expand the application's action surface; indiscriminate activation increases risk and can confuse model selection among similar functions and user settings are scoped to one person, so they should not be relied on for enforcing team-wide policy; the required capabilities are instead to determine whether a quality regression came from a recent instruction edit and to reproduce production behavior across deploys instead of silently adopting a new model release.
D:The first step is appropriate for the requirement to determine whether a quality regression came from a recent instruction edit because a prompt is a behavior-changing artifact; versioning makes comparisons and safe reversions possible during incident response; the other step instead aims to customize one developer's default Claude Code behavior across local projects because user settings are scoped to one person, so they should not be relied on for enforcing team-wide policy, which does not meet the second requirement to reproduce production behavior across deploys instead of silently adopting a new model release.
Question 290
The technical owner of an internal coding-assistant workflow has to build a Claude-powered coding agent with an established runtime for tool orchestration. A separate requirement is to minimize infrastructure ownership for a supported hosted agent execution surface. Which two-part remediation covers both?
- Perform both steps: (1) Attach a post-execution observation hook to the tool lifecycle; (2) alternate model tool-use requests with tool results until completion.
- Perform both steps: (1) Attach a post-execution observation hook to the tool lifecycle; (2) evaluate a managed agent runtime against the deployment requirements.
- Perform both steps: (1) Use the Claude Agent SDK for the agent's execution harness; (2) alternate model tool-use requests with tool results until completion.
- Perform both steps: (1) Use the Claude Agent SDK for the agent's execution harness; (2) evaluate a managed agent runtime against the deployment requirements.
Explanation
Correct Answer
D:The first change enables the team to build a Claude-powered coding agent with an established runtime for tool orchestration because the SDK provides structured primitives for agent sessions and tool execution, reducing the custom loop infrastructure the application must maintain; the second addresses the separate need to minimize infrastructure ownership for a supported hosted agent execution surface because a managed runtime can take on execution infrastructure, but access controls, product availability, and data-handling needs still require evaluation.
Incorrect Answers
A:Both steps target different results—inspect the result of a completed tool call before later model reasoning consumes it and plan another step only after inspecting the result of a requested external operation—because post-tool inspection can record or validate outcomes after execution, but it cannot retroactively prevent side effects from the completed call and the loop returns observations to the model so subsequent decisions are informed by actual tool output rather than imagined execution; the required capabilities are instead to build a Claude-powered coding agent with an established runtime for tool orchestration and to minimize infrastructure ownership for a supported hosted agent execution surface.
B:The second step meets the requirement to minimize infrastructure ownership for a supported hosted agent execution surface because a managed runtime can take on execution infrastructure, but access controls, product availability, and data-handling needs still require evaluation; the first step would only help to inspect the result of a completed tool call before later model reasoning consumes it because post-tool inspection can record or validate outcomes after execution, but it cannot retroactively prevent side effects from the completed call, leaving the separate requirement to build a Claude-powered coding agent with an established runtime for tool orchestration unmet.
C:The first step is appropriate for the requirement to build a Claude-powered coding agent with an established runtime for tool orchestration because the SDK provides structured primitives for agent sessions and tool execution, reducing the custom loop infrastructure the application must maintain; the other step instead aims to plan another step only after inspecting the result of a requested external operation because the loop returns observations to the model so subsequent decisions are informed by actual tool output rather than imagined execution, which does not meet the second requirement to minimize infrastructure ownership for a supported hosted agent execution surface.