Question 250
An API client works locally but fails in a company proxy network. What should debugging test?
- Cap attempts and total elapsed time to avoid runaway request chains.
- Inspect proxy, TLS trust, and outbound connectivity before changing prompts.
- Relay requests through a trusted backend that owns credentials and authorization.
- Introduce a conforming JSON parser and validate the resulting structure.
Explanation
Correct Answer
B:Network policies can prevent an otherwise valid request from reaching the service; this is distinct from model behavior.
Incorrect Answers
A:Retries consume quota and latency; persistent failures need a terminal result or fallback rather than unbounded recursion; the consequence is improved bounded retry lifecycle, not verified enterprise networking for SDK.
C:Browser-delivered code and network requests are inspectable by end users; a backend prevents key disclosure and centralizes limits; changing SDK use in untrusted clients does not establish enterprise networking for SDK in this application.
D:JSON permits nested arrays, escaped strings, and delimiters inside strings; textual splitting is unsafe; the scenario's controlling requirement is enterprise networking for SDK, not the related standards-compliant JSON parsing concern.
Question 251
A developer decides to use WebSockets solely because the term 'real-time AI' appears in requirements. What should guide the choice?
- Store transport errors, HTTP statuses, and model stop reasons as separate layers.
- Deliver valid JSON with documented field types and errors.
- Apply the documented HTTP streaming interface when that satisfies the client.
- Select transport from actual event direction, latency, and connection needs.
Explanation
Correct Answer
D:Streaming HTTP may suffice for incremental text, while persistent bidirectional features warrant a different design.
Incorrect Answers
A:A network timeout prevents a completed response, whereas a model refusal or truncation can occur after successful transport; it changes layered API failure taxonomy; it does not prove requirements-driven transport in this case.
B:A typed response contract supports robust client parsing and version compatibility; free-text conventions are brittle; where requirements-driven transport matters, a control for stable REST JSON contract leaves that test unmet.
C:Server-sent events can deliver incremental content over HTTP; WebSockets serve different bidirectional communication patterns; testing requirements-driven transport would still fail after improving SSE versus WebSocket selection.
Question 252
A backend receives a body that looks like JSON but has a trailing comma. What should happen?
- Reject or repair it through explicit parsing and schema handling rather than assuming validity.
- Interpret the SDK as a convenience client over supported API transport and schemas.
- Constrain attempts and total elapsed time to avoid runaway request chains.
- Attach messages to client-managed history and send the relevant sequence again.
- Close upstream workers when a downstream streaming subscriber disconnects.
Explanation
Correct Answer
A:JSON grammar does not permit arbitrary JavaScript object-literal shortcuts; downstream processing needs strict parsing.
Incorrect Answers
B:SDKs simplify authentication and serialization, but they do not eliminate remote latency, quotas, or request-contract constraints; this targets SDK and REST relationship, while the system must demonstrate malformed JSON syntax.
C:Retries consume quota and latency; persistent failures need a terminal result or fallback rather than unbounded recursion; because bounded retry lifecycle is its concern, malformed JSON syntax remains outside its effect here.
D:The Messages endpoint does not implicitly retain an application conversation identifier as the full prompt history; a remedy for client-owned chat state is not a substitute for malformed JSON syntax.
E:Stream cancellation is unrelated to invalid JSON syntax. A JSON parser should reject the trailing comma and return a parse error; stopping upstream workers only manages connection resources.
Question 253
A distributed service must trace one user request across frontend, inference, and tool APIs. What metadata should propagate?
- Review proxy, TLS trust, and outbound connectivity before changing prompts.
- Adopt a transport that supports two-way messages and connection lifecycle management.
- Understand status and error media type before attempting a success-object parse.
- Carry a correlation identifier through each service boundary.
Explanation
Correct Answer
D:End-to-end IDs link latency and errors across transports without exposing private prompt content as the lookup key.
Incorrect Answers
A:Network policies can prevent an otherwise valid request from reaching the service; this is distinct from model behavior; this implements enterprise networking for SDK rather than the demanded distributed request correlation.
B:WebSockets maintain a bidirectional channel; they are not synonymous with a standard one-way streamed Messages response; where distributed request correlation matters, a control for bidirectional transport need leaves that test unmet.
C:Failure payloads can differ from success messages; treating every body as one type can conceal the actual cause; changing error body format handling does not establish distributed request correlation in this application.
Question 254
An application uses async methods but launches unlimited model calls in parallel. What additional control is required?
- Terminate or stop forwarding work and release resources when the downstream stream closes.
- Bound concurrency and honor rate or token limits.
- For this workflow, select transport from actual event direction, latency, and connection needs.
- At the application layer, reject or repair it through explicit parsing and schema handling rather than assuming validity.
Explanation
Correct Answer
B:Async code improves I/O efficiency, but it does not grant unlimited upstream capacity; semaphores and queues protect quotas.
Incorrect Answers
A:Streaming connections have lifecycle and backpressure concerns; ignoring disconnects wastes capacity and can retain orphaned operations; this may help stream cancellation handling but cannot by itself deliver async concurrency backpressure.
C:Streaming HTTP may suffice for incremental text, while persistent bidirectional features warrant a different design; it improves requirements-driven transport only, leaving async concurrency backpressure unproven.
D:JSON grammar does not permit arbitrary JavaScript object-literal shortcuts; downstream processing needs strict parsing; for async concurrency backpressure, a control centered on malformed JSON syntax is not the appropriate substitute.
Question 255
An engineer wants to reuse authenticated connection pools safely. What should an SDK integration avoid?
- Set SDK dependencies and review release notes with integration tests.
- Check proxy, TLS trust, and outbound connectivity before changing prompts.
- At the application layer, select transport from actual event direction, latency, and connection needs.
- Do not mutate shared client defaults with per-user secrets during concurrent operations.
Explanation
Correct Answer
D:Connection reuse is distinct from authorization state; per-request credential isolation prevents cross-tenant credential confusion.
Incorrect Answers
A:Client libraries evolve independently of model behavior; version control prevents silent application-level regressions; for safe client reuse, a control centered on SDK version management is not the appropriate substitute.
B:Network policies can prevent an otherwise valid request from reaching the service; this is distinct from model behavior; a remedy for enterprise networking for SDK is not a substitute for safe client reuse.
C:Streaming HTTP may suffice for incremental text, while persistent bidirectional features warrant a different design; changing requirements-driven transport does not establish safe client reuse in this application.
Question 256
A browser sends API keys directly in JavaScript to reduce backend work. Which architecture corrects this?
- Proxy requests through a trusted backend that owns credentials and authorization.
- Constrain concurrency and honor rate or token limits.
- Document transport errors, HTTP statuses, and model stop reasons as separate layers.
- Retain a correlation identifier through each service boundary.
Explanation
Correct Answer
A:Browser-delivered code and network requests are inspectable by end users; a backend prevents key disclosure and centralizes limits.
Incorrect Answers
B:Async code improves I/O efficiency, but it does not grant unlimited upstream capacity; semaphores and queues protect quotas; testing SDK use in untrusted clients would still fail after improving async concurrency backpressure.
C:A network timeout prevents a completed response, whereas a model refusal or truncation can occur after successful transport; changing layered API failure taxonomy does not establish SDK use in untrusted clients in this application.
D:End-to-end IDs link latency and errors across transports without exposing private prompt content as the lookup key; it changes distributed request correlation; it does not prove SDK use in untrusted clients in this case.
Question 257
A service gets an HTTP error whose body cannot be decoded as the usual success schema. What should the parser branch on first?
- Interpret status and error media type before attempting a success-object parse.
- Evaluate proxy, TLS trust, and outbound connectivity before changing prompts.
- Apply the documented request method and endpoint for Messages creation.
- At the application layer, do not mutate shared client defaults with per-user secrets during concurrent operations.
Explanation
Correct Answer
A:Failure payloads can differ from success messages; treating every body as one type can conceal the actual cause.
Incorrect Answers
B:Network policies can prevent an otherwise valid request from reaching the service; this is distinct from model behavior; the scenario's controlling requirement is error body format handling, not the related enterprise networking for SDK concern.
C:API method semantics are part of the contract; arbitrary verb substitutions can fail before model inference begins; when the goal is error body format handling, optimizing HTTP method correctness misses that operational boundary.
D:Connection reuse is distinct from authorization state; per-request credential isolation prevents cross-tenant credential confusion; even if safe client reuse succeeds, error body format handling still needs separate verification.
Question 258
A client must upload binary content alongside a text question. What transport responsibility remains with the developer?
- Encode content using the API's supported message content-block format.
- Handle the SDK as a convenience client over supported API transport and schemas.
- Define the documented media type and serialize the request as valid JSON.
- Route requests through a trusted backend that owns credentials and authorization.
Explanation
Correct Answer
A:SDK conveniences do not mean arbitrary binary streams or local paths become valid request fields; content representation remains contractual.
Incorrect Answers
B:SDKs simplify authentication and serialization, but they do not eliminate remote latency, quotas, or request-contract constraints; the effect concerns SDK and REST relationship; the success condition is binary-to-content encoding.
C:The endpoint must know the payload format, and successful serialization must obey the API's JSON grammar; testing binary-to-content encoding would still fail after improving HTTP JSON content type.
D:Browser-delivered code and network requests are inspectable by end users; a backend prevents key disclosure and centralizes limits; the effect concerns SDK use in untrusted clients; the success condition is binary-to-content encoding.
Question 259
A service switches SDK versions and sees different helper behavior but the wire API is stable. What maintenance practice helps?
- Put in place a conforming JSON parser and validate the resulting structure.
- Classify the SDK as a convenience client over supported API transport and schemas.
- Choose the documented HTTP streaming interface when that satisfies the client.
- Pin SDK dependencies and review release notes with integration tests.
Explanation
Correct Answer
D:Client libraries evolve independently of model behavior; version control prevents silent application-level regressions.
Incorrect Answers
A:JSON permits nested arrays, escaped strings, and delimiters inside strings; textual splitting is unsafe; it follows standards-compliant JSON parsing constraints but leaves SDK version management unspecified.
B:SDKs simplify authentication and serialization, but they do not eliminate remote latency, quotas, or request-contract constraints; because SDK and REST relationship is its concern, SDK version management remains outside its effect here.
C:Server-sent events can deliver incremental content over HTTP; WebSockets serve different bidirectional communication patterns; changing SSE versus WebSocket selection does not establish SDK version management in this application.
Question 260
A large-scale tagger processes easy, short classifications and is dominated by latency and cost. Which model-selection tendency is sensible?
- Contrast feature parity, quotas, authentication, and region availability for that route.
- Assess a Sonnet-class model as a quality-latency compromise.
- Execute workload-specific evaluations measuring quality, latency, and total cost.
- Commit to the absolute lowest-latency model without testing classification quality.
- Benchmark a fast Haiku-class model against the required accuracy threshold.
Explanation
Correct Answer
E:Lightweight tasks may not need higher-cost reasoning; measured acceptance quality should decide whether the speed benefit is acceptable.
Incorrect Answers
A:Equivalent model names do not imply equivalent API surfaces or governance controls on every hosting provider; where inexpensive simple classification matters, a control for provider feature parity leaves that test unmet.
B:The middle tier is designed for balanced workloads; task-specific tests should confirm that it meets the acceptance targets; testing inexpensive simple classification would still fail after improving balanced assistant model baseline.
C:Public benchmarks may not represent proprietary inputs or tools; a measured tradeoff is more defensible than a brand label; because production model bakeoff is its concern, inexpensive simple classification remains outside its effect here.
D:Speed alone does not establish that the tagger meets precision and recall requirements. A smaller model should be benchmarked against acceptance thresholds before being selected.