Anthropic CCDV-F (Claude Certified Developer - Foundations) Practice Test 25

Question 240

A service needs a persistent, bidirectional event channel for application coordination. Which transport characteristic matters?

  1. Limit attempts and total elapsed time to avoid runaway request chains.
  2. Choose a transport that supports two-way messages and connection lifecycle management.
  3. Lock SDK dependencies and review release notes with integration tests.
  4. Use a conforming JSON parser and validate the resulting structure.

Explanation

Correct Answer

B:

WebSockets maintain a bidirectional channel; they are not synonymous with a standard one-way streamed Messages response.

Incorrect Answers

A:

Retries consume quota and latency; persistent failures need a terminal result or fallback rather than unbounded recursion; this may help bounded retry lifecycle but cannot by itself deliver bidirectional transport need.

C:

Client libraries evolve independently of model behavior; version control prevents silent application-level regressions; this implements SDK version management rather than the demanded bidirectional transport need.

D:

JSON permits nested arrays, escaped strings, and delimiters inside strings; textual splitting is unsafe; it changes standards-compliant JSON parsing; it does not prove bidirectional transport need in this case.

Question 241

A client parses JSON by splitting on commas and breaks on nested objects. What should it use?

  1. Pass a correlation identifier through each service boundary.
  2. Employ the documented HTTP streaming interface when that satisfies the client.
  3. Read status and error media type before attempting a success-object parse.
  4. Apply a conforming JSON parser and validate the resulting structure.
  5. Establish the documented media type and serialize the request as valid JSON.

Explanation

Correct Answer

D:

JSON permits nested arrays, escaped strings, and delimiters inside strings; textual splitting is unsafe. A compliant parser also returns structured errors for malformed or incomplete payloads instead of inventing missing fields.

Incorrect Answers

A:

End-to-end IDs link latency and errors across transports without exposing private prompt content as the lookup key; changing distributed request correlation does not establish standards-compliant JSON parsing in this application.

B:

Server-sent events can deliver incremental content over HTTP; WebSockets serve different bidirectional communication patterns; this targets SSE versus WebSocket selection, while the system must demonstrate standards-compliant JSON parsing.

C:

Failure payloads can differ from success messages; treating every body as one type can conceal the actual cause; the effect concerns error body format handling; the success condition is standards-compliant JSON parsing.

E:

The endpoint must know the payload format, and successful serialization must obey the API's JSON grammar; it changes HTTP JSON content type; it does not prove standards-compliant JSON parsing in this case.

Question 242

An SDK returns a typed exception for rate limiting. What should the application do with that abstraction?

  1. Map it to a quota-aware retry policy rather than catching every error identically.
  2. Adopt the documented request method and endpoint for Messages creation.
  3. Log transport errors, HTTP statuses, and model stop reasons as separate layers.
  4. Fix SDK dependencies and review release notes with integration tests.

Explanation

Correct Answer

A:

Typed SDK errors expose protocol meaning; retryability differs between throttling, invalid input, and authentication failures.

Incorrect Answers

B:

API method semantics are part of the contract; arbitrary verb substitutions can fail before model inference begins; because HTTP method correctness is its concern, typed SDK error handling remains outside its effect here.

C:

A network timeout prevents a completed response, whereas a model refusal or truncation can occur after successful transport; for this request, typed SDK error handling is the missing piece, not layered API failure taxonomy.

D:

Client libraries evolve independently of model behavior; version control prevents silent application-level regressions; a remedy for SDK version management is not a substitute for typed SDK error handling.

Question 243

A system uses one shared API client with mutable default headers per tenant. What bug could arise?

  1. Every request gets an immutable tenant identity merely because it uses an SDK.
  2. Shared mutable headers cause only a slower response and cannot affect authentication.
  3. Tenant-specific authentication may leak across concurrent requests.
  4. The model will correct a wrong tenant header before any tool call executes.

Explanation

Correct Answer

C:

Shared mutable request state can race; credentials should be selected per isolated request or client context. Per-request header construction or immutable per-tenant clients prevent another concurrent tenant's credential from being reused.

Incorrect Answers

A:

An SDK does not isolate mutations of shared client defaults that are performed concurrently by application code.

B:

A race between callers can attach one tenant’s authorization header to another tenant’s request. That race can expose confidential records across tenant boundaries.

D:

Authentication headers are transport-layer data, not self-healing fields controlled by the model. The transport layer must select the correct credential per request.

Question 244

A developer uses a synchronous HTTP call inside an event loop for each chat message. What is the performance cost?

  1. Blocking the event loop affects only the caller whose HTTP operation is pending.
  2. Synchronous networking shortens the remote model’s generation time automatically.
  3. Blocking I/O stalls unrelated tasks on the same event loop.
  4. The runtime converts every synchronous SDK call into nonblocking I/O by default.

Explanation

Correct Answer

C:

Nonblocking clients allow the loop to service other work while remote inference is pending. With many simultaneous sessions, blocking the event loop amplifies latency even when the remote API is otherwise responsive.

Incorrect Answers

A:

In a single-threaded event loop, blocking I/O prevents other scheduled callbacks and requests from progressing.

B:

Local blocking behavior changes concurrency, not the inference service’s actual processing workload. Only nonblocking request handling helps this client-side concurrency problem.

D:

A blocking call remains blocking unless executed through an appropriate asynchronous interface or worker. Use the supported asynchronous interface for concurrent conversations.

Question 245

A service streams content to browsers but must detect client disconnects. What should its server handle?

  1. Forward requests through a trusted backend that owns credentials and authorization.
  2. Serialize content using the API's supported message content-block format.
  3. Cancel or stop forwarding work and release resources when the downstream stream closes.
  4. As an alternative, select transport from actual event direction, latency, and connection needs.

Explanation

Correct Answer

C:

Streaming connections have lifecycle and backpressure concerns; ignoring disconnects wastes capacity and can retain orphaned operations.

Incorrect Answers

A:

Browser-delivered code and network requests are inspectable by end users; a backend prevents key disclosure and centralizes limits; it changes SDK use in untrusted clients; it does not prove stream cancellation handling in this case.

B:

SDK conveniences do not mean arbitrary binary streams or local paths become valid request fields; content representation remains contractual; because binary-to-content encoding is its concern, stream cancellation handling remains outside its effect here.

D:

Streaming HTTP may suffice for incremental text, while persistent bidirectional features warrant a different design; even if requirements-driven transport succeeds, stream cancellation handling still needs separate verification.

Question 246

A front end asks an API to return machine-readable results. What format contract is appropriate?

  1. Link it to a quota-aware retry policy rather than catching every error identically.
  2. As an alternative, reject or repair it through explicit parsing and schema handling rather than assuming validity.
  3. Return valid JSON with documented field types and errors.
  4. Select a transport that supports two-way messages and connection lifecycle management.

Explanation

Correct Answer

C:

A typed response contract supports robust client parsing and version compatibility; free-text conventions are brittle.

Incorrect Answers

A:

Typed SDK errors expose protocol meaning; retryability differs between throttling, invalid input, and authentication failures; for stable REST JSON contract, this instead manages typed SDK error handling; the requested decision remains unresolved.

B:

JSON grammar does not permit arbitrary JavaScript object-literal shortcuts; downstream processing needs strict parsing; the effect concerns malformed JSON syntax; the success condition is stable REST JSON contract.

D:

WebSockets maintain a bidirectional channel; they are not synonymous with a standard one-way streamed Messages response; when the goal is stable REST JSON contract, optimizing bidirectional transport need misses that operational boundary.

Question 247

A developer implements retries with a recursive function lacking a maximum depth. What risk must be addressed?

  1. Bound attempts and total elapsed time to avoid runaway request chains.
  2. For this workflow, do not mutate shared client defaults with per-user secrets during concurrent operations.
  3. For this workflow, reject or repair it through explicit parsing and schema handling rather than assuming validity.
  4. Cap concurrency and honor rate or token limits.
  5. Adopt the documented HTTP streaming interface when that satisfies the client.

Explanation

Correct Answer

A:

Retries consume quota and latency; persistent failures need a terminal result or fallback rather than unbounded recursion.

Incorrect Answers

B:

Connection reuse is distinct from authorization state; per-request credential isolation prevents cross-tenant credential confusion; changing safe client reuse does not establish bounded retry lifecycle in this application.

C:

JSON grammar does not permit arbitrary JavaScript object-literal shortcuts; downstream processing needs strict parsing; because malformed JSON syntax is its concern, bounded retry lifecycle remains outside its effect here.

D:

Async code improves I/O efficiency, but it does not grant unlimited upstream capacity; semaphores and queues protect quotas; a remedy for async concurrency backpressure is not a substitute for bounded retry lifecycle.

E:

Server-sent events can deliver incremental content over HTTP; WebSockets serve different bidirectional communication patterns; the effect concerns SSE versus WebSocket selection; the success condition is bounded retry lifecycle.

Question 248

An application sends JSON but omits the content-type header, and the server rejects the body. What should it correct?

  1. Classify status and error media type before attempting a success-object parse.
  2. Close downstream streaming connections only after their receivers disconnect.
  3. Set the documented media type and serialize the request as valid JSON.
  4. Enforce a conforming JSON parser and validate the resulting structure.

Explanation

Correct Answer

C:

The endpoint must know the payload format, and successful serialization must obey the API's JSON grammar. Check the API version and authorization headers as well; valid JSON alone does not make the HTTP request contract complete.

Incorrect Answers

A:

Failure payloads can differ from success messages; treating every body as one type can conceal the actual cause; it changes error body format handling; it does not prove HTTP JSON content type in this case.

B:

A stream cancellation policy addresses resource lifetime, not the server requirement to label submitted JSON with an accepted media type. The missing content-type header would remain unfixed.

D:

JSON permits nested arrays, escaped strings, and delimiters inside strings; textual splitting is unsafe; a remedy for standards-compliant JSON parsing is not a substitute for HTTP JSON content type.

Question 249

A client needs to update an existing local conversation rather than create a new server-side session. What state handling is required?

  1. Provide valid JSON with documented field types and errors.
  2. Capture transport errors, HTTP statuses, and model stop reasons as separate layers.
  3. Append messages to client-managed history and send the relevant sequence again.
  4. Pick a transport that supports two-way messages and connection lifecycle management.

Explanation

Correct Answer

C:

The Messages endpoint does not implicitly retain an application conversation identifier as the full prompt history.

Incorrect Answers

A:

A typed response contract supports robust client parsing and version compatibility; free-text conventions are brittle; because stable REST JSON contract is its concern, client-owned chat state remains outside its effect here.

B:

A network timeout prevents a completed response, whereas a model refusal or truncation can occur after successful transport; the client-owned chat state criterion differs from layered API failure taxonomy; the gap persists.

D:

WebSockets maintain a bidirectional channel; they are not synonymous with a standard one-way streamed Messages response; the consequence is improved bidirectional transport need, not verified client-owned chat state.

Question 250

An API client works locally but fails in a company proxy network. What should debugging test?

  1. Cap attempts and total elapsed time to avoid runaway request chains.
  2. Inspect proxy, TLS trust, and outbound connectivity before changing prompts.
  3. Relay requests through a trusted backend that owns credentials and authorization.
  4. 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.

Claude Certified Developer - Foundations (CCDV-F) Practice Tests