Question 110
A Messages API harness receives a tool_use response and then a final end_turn response after processing results. Which TWO behaviors are correct? Choose TWO.
- Dispatch each client tool and send a matching tool_result block.
- Stop requesting further tool work after end_turn is received.
- Discard assistant tool_use blocks before resubmission.
- Treat end_turn as evidence that a network retry is needed.
- Execute tool_result as if it were a new requested operation.
Explanation
Correct Answers
A:The caller must perform client-side execution and associate its results with the original tool request IDs. Keep the assistant tool request in history and return the outcome as a user-side tool result for continuation.
B:A natural end_turn marks completion of the assistant turn; another iteration is not automatically required. The host should finalize that response rather than interpreting the stop marker as an instruction to invoke tools again.
Incorrect Answers
C:The tool result needs the preceding assistant requests to preserve coherent protocol history. Dropping requests destroys the reference needed to associate results with model-selected tool names and arguments.
D:Normal completion is distinct from transport failure or output truncation. Retry decisions should follow an actual transport error or explicit operation policy, not a successful termination marker.
E:tool_result reports the execution outcome; it is not itself a command to dispatch. A result describes what a client tool returned and is not a separate authorization to execute that payload.
Question 111
A response is returned from a model call, but the model did not issue any requested tool operation. Which signal should the harness examine before assuming an API bug?
- Allow prompt caching on the reusable prefix of the request.
- Transmit again the relevant prior messages or maintained conversation state with each request.
- Wait before executing the mutating client tool and await explicit approval.
- Inspect tool_choice, tool definitions, and the returned stop_reason and content blocks.
Explanation
Correct Answer
D:Tool invocation can be model-selected or forced within supported modes; observing the actual response distinguishes selection behavior from integration failure.
Incorrect Answers
A:Cache hits avoid reprocessing the identical policy prefix; dynamic user content should appear after the stable portion; for tool selection diagnostics, this instead manages shared request prefix reuse; the requested decision remains unresolved.
B:The Messages API is stateless with respect to caller history; the client owns the turns it wants Claude to use; where tool selection diagnostics matters, a control for explicit conversation history leaves that test unmet.
C:The model may generate a valid tool request, but the host owns side effects and can withhold execution until policy authorization is satisfied; this targets approval before tool execution, while the system must demonstrate tool selection diagnostics.
Question 112
An endpoint returns HTTP 200 but an unexpected response schema breaks the UI. What check belongs at the boundary?
- Validate the payload against the application's expected response contract.
- Introduce defensive parsing with explicit schema-error paths and fallback behavior.
- Create an event-driven stream parser with explicit completion and error states.
- As an alternative, introduce a compatible default or version the contract with a migration path.
Explanation
Correct Answer
A:Transport success confirms delivery, not data shape; schema checks catch incompatible or incomplete integration output before it reaches consumers.
Incorrect Answers
B:Generation and network success do not remove the need to handle malformed or semantically invalid data safely; when the goal is response contract validation, optimizing robust typed output parsing misses that operational boundary.
C:Streaming protocols deliver more than plain characters; stateful parsing ensures consumers know when content is complete; this implements event-stream parser state rather than the demanded response contract validation.
D:Adding a newly required field can break existing callers; backward compatibility must be managed explicitly; the response contract validation criterion differs from schema compatibility evolution; the gap persists.
Question 113
A backend exposes an order-summary endpoint used by several clients. What design avoids duplicating Claude API keys in those clients?
- Separate environment credentials and grant each only required access.
- Keep Claude calls in a server-side service and expose a restricted application API.
- Withdraw the exposed key and move credential loading to a secret manager or environment.
- Lock model, prompt, tool schema, and application configuration under change control.
Explanation
Correct Answer
B:A backend boundary centralizes secrets, rate limits, authorization, and prompt versions rather than shipping privileged credentials to browsers.
Incorrect Answers
A:Environment isolation limits accidental production effects from tests and makes revocation less disruptive; it follows environment-scoped credentials constraints but leaves server-side credential boundary unspecified.
C:Deleting a commit does not invalidate a leaked credential; rotation and an external secret source are needed to contain the exposure; because exposed source-controlled credential is its concern, server-side credential boundary remains outside its effect here.
D:Reproducibility depends on all behavior-shaping inputs, not only the application binary; the consequence is improved reproducible inference configuration, not verified server-side credential boundary.
Question 114
A team includes a Claude secret in a committed source file. What is the required remediation?
- Record status, correlation ID, latency, and safe error classification without secrets.
- Retrieve authoritative data at execution time and supply it as referenced context.
- Verify the payload against the application's expected response contract.
- Revoke the exposed key and move credential loading to a secret manager or environment.
- Test authentication, permission denial, and representative storage responses in a controlled environment.
Explanation
Correct Answer
D:Deleting a commit does not invalidate a leaked credential; rotation and an external secret source are needed to contain the exposure.
Incorrect Answers
A:Structured metadata supports incident triage and vendor support while avoiding accidental logging of sensitive prompts or keys; it follows safe API error telemetry constraints but leaves exposed source-controlled credential unspecified.
B:The model's learned information is not a live database; the application must retrieve current records when freshness matters; this may help current external data acquisition but cannot by itself deliver exposed source-controlled credential.
C:Transport success confirms delivery, not data shape; schema checks catch incompatible or incomplete integration output before it reaches consumers; for exposed source-controlled credential, a control centered on response contract validation is not the appropriate substitute.
E:Tool behavior depends on external credentials and data contracts, which pure prompt tests cannot cover; for exposed source-controlled credential, this instead manages external service integration coverage; the requested decision remains unresolved.
Question 115
A service needs to call Claude, enrich the result from a database, and return JSON while serving many users. What programming structure helps?
- Use asynchronous I/O and enforce concurrency limits on external requests.
- Verify status and content type before attempting JSON decoding.
- As an alternative, assert task-level invariants and structured fields rather than exact prose.
- Keep the relevant request schema, content block sequence, and observed response metadata.
Explanation
Correct Answer
A:Network calls can overlap without tying up a worker for each wait; bounded parallelism avoids saturating dependencies.
Incorrect Answers
B:Assumed JSON parsing can obscure the real transport failure; protocol metadata must be validated first; for this request, nonblocking service I/O is the missing piece, not defensive HTTP content parsing.
C:Non-deterministic language variation makes string snapshots brittle, while behavior and schema assertions capture meaningful correctness; this implements model-response test invariants rather than the demanded nonblocking service I/O.
D:Exact protocol inputs and stop conditions distinguish integration bugs from variations in model wording; this may help reproducible tool-call bug report but cannot by itself deliver nonblocking service I/O.
Question 116
An API client receives an intermittent 503 and the operation is read-only. What should retry logic consider?
- Mandate schema diffs and contract tests for the affected tool boundary.
- For this workflow, introduce a compatible default or version the contract with a migration path.
- Retry transient failures with backoff, jitter, and an overall attempt limit.
- As an alternative, make task processing idempotent and record completion by stable task ID.
Explanation
Correct Answer
C:Temporary service errors often recover; spreading and bounding retries reduces synchronized bursts and runaway latency.
Incorrect Answers
A:Reviewers need to see both the field changes and their behavioral impact on model-proposed arguments and downstream execution; it follows reviewable tool schema changes constraints but leaves transient service retry strategy unspecified.
B:Adding a newly required field can break existing callers; backward compatibility must be managed explicitly; this may help schema compatibility evolution but cannot by itself deliver transient service retry strategy.
D:Delivery semantics do not imply exactly-once side effects; deduplication and durable completion records prevent repeated mutations; where transient service retry strategy matters, a control for queue delivery idempotency leaves that test unmet.
Question 117
An HTTP client retries a create-order call after a timeout, but the first attempt may have succeeded. What is the core hazard?
- An HTTP timeout always cancels the first create-order transaction.
- Duplicate writes unless the operation is idempotent or deduplicated.
- The HTTP protocol guarantees that a repeated POST cannot create another order.
- The client can safely assume that every unacknowledged order was rejected.
Explanation
Correct Answer
B:Timeout does not prove failure; an idempotency token or read-after-write check is needed before replaying a business mutation.
Incorrect Answers
A:The server may commit before the caller loses the response, so relying on cancellation can cause a second order.
C:HTTP POST is not inherently idempotent; duplicate prevention needs application-defined operation identity. This is why the order service needs a durable deduplication mechanism.
D:A missing response proves only that the acknowledgment was not received, not that the remote write failed. A follow-up state lookup may be needed to learn what committed.
Question 118
A service accepts model-generated JSON and writes values directly into SQL string literals. Which correction is required?
- Reattempt transient failures with backoff, jitter, and an overall attempt limit.
- Monitor emitted content and reconnect semantics to prevent replaying the same deltas.
- Isolate environment credentials and grant each only required access.
- Parse and validate fields, then use parameterized database queries.
Explanation
Correct Answer
D:The output is untrusted data even if generated by Claude; parameter binding prevents injection through constructed SQL syntax.
Incorrect Answers
A:Temporary service errors often recover; spreading and bounding retries reduces synchronized bursts and runaway latency; the effect concerns transient service retry strategy; the success condition is safe persistence of generated data.
B:Stream resumption and client rendering require explicit ordering and deduplication assumptions; reconnecting is not automatically exactly once; the effect concerns streaming UI deduplication; the success condition is safe persistence of generated data.
C:Environment isolation limits accidental production effects from tests and makes revocation less disruptive; it improves environment-scoped credentials only, leaving safe persistence of generated data unproven.
Question 119
An integration developer needs to add a required field to the public API without breaking old clients. What should be planned?
- Maintain the relevant request schema, content block sequence, and observed response metadata.
- For this workflow, make task processing idempotent and record completion by stable task ID.
- Introduce a compatible default or version the contract with a migration path.
- Associate internal failures into safe, stable, actionable client error categories.
- Combine shared request handling into a tested client adapter.
Explanation
Correct Answer
C:Adding a newly required field can break existing callers; backward compatibility must be managed explicitly. Use contract tests for both existing and upgraded consumers so the field transition does not silently invalidate older payloads.
Incorrect Answers
A:Exact protocol inputs and stop conditions distinguish integration bugs from variations in model wording; this implements reproducible tool-call bug report rather than the demanded schema compatibility evolution.
B:Delivery semantics do not imply exactly-once side effects; deduplication and durable completion records prevent repeated mutations; it follows queue delivery idempotency constraints but leaves schema compatibility evolution unspecified.
D:Exposing internals leaks implementation details and produces brittle clients; a boundary can preserve detailed logs while presenting safe errors; testing schema compatibility evolution would still fail after improving safe error abstraction.
E:One adapter standardizes error mapping, headers, and retry policy, reducing drift across different application paths; it follows shared Claude transport abstraction constraints but leaves schema compatibility evolution unspecified.
Question 120
A Git pull request changes the payment tool's schema. What review artifact most directly reduces production risk?
- Employ a bounded worker queue with backpressure and rate-limit awareness.
- Interpret and validate fields, then use parameterized database queries.
- Fix model, prompt, tool schema, and application configuration under change control.
- Require schema diffs and contract tests for the affected tool boundary.
Explanation
Correct Answer
D:Reviewers need to see both the field changes and their behavioral impact on model-proposed arguments and downstream execution.
Incorrect Answers
A:Concurrency improves throughput only until it overwhelms quotas or dependencies; queueing provides controlled resource use; the scenario's controlling requirement is reviewable tool schema changes, not the related scalable request queueing concern.
B:The output is untrusted data even if generated by Claude; parameter binding prevents injection through constructed SQL syntax; when the goal is reviewable tool schema changes, optimizing safe persistence of generated data misses that operational boundary.
C:Reproducibility depends on all behavior-shaping inputs, not only the application binary; it follows reproducible inference configuration constraints but leaves reviewable tool schema changes unspecified.