Anthropic certification · Exam CCDV-F

CCDV-F Mock Exam Page 3

Claude Certified Developer-Foundations

Free CCDV-F mock exam questions 21–24, each with the answer and an explanation.

20 questions · 46 minutes · free, no sign-up

Free CCDV-F questions

21–24 of 24 free
Question 21 Choose 1
The Claude application your team built has grown over six months, and the prompt-handling code has accumulated duplication and tangled control flow. The functionality is working, but new features are getting harder to add. How would you address this?
Show answerHide answer

Correct answer: A Plan a refactoring pass to consolidate duplicated logic, separate concerns, and simplify control flow before adding new features.

Explanation

Explanation

This is textbook technical debt blocking new work: the code functions, but duplication and tangled control flow make features increasingly hard to add. The recognized remedy is a planned refactoring pass that consolidates duplicated logic, separates concerns, and simplifies control flow. Because the problem is now actively slowing feature delivery, addressing it before piling on more features prevents the debt from compounding and keeps the new features from being built on an unstable base.

A planned, scoped refactor is also safer than ad hoc cleanup: it can be defined, tested (behavior-preserving), reviewed, and validated in one deliberate effort — which is exactly how you refactor safely without changing functionality.

Why the other options are incorrect

- B — "Refactor in small increments as a side effect of each feature ticket": Incremental refactoring can be legitimate, but folding cleanup into feature work tangles two goals: it makes feature changes harder to review, risks scope creep, and doesn't systematically address the duplication and tangled control flow that spans the codebase.

- C — "Keep adding features; refactor after the next two release cycles": Defers the debt while continuing to build on the tangled base — the cost grows, the refactor gets harder, and the "when we have bandwidth" condition rarely arrives. This is how technical debt compounds.

- D — "Move everything into one large function": The opposite of good structure — it worsens coupling and readability, making the code harder to navigate and change, not easier.

References

- Refactoring and technical-debt management best practice — planned, behavior-preserving refactors to reduce duplication and separate concerns.
Question 22 Choose 1
You are integrating Claude into an application written in Python. The Claude SDK provides a Python client that wraps the underlying REST API. How would you integrate the SDK?
Show answerHide answer

Correct answer: B Use the Claude Python SDK and let it handle authentication, retries, and response parsing through its standard documented patterns for Python integrations.

Explanation

Explanation

The Claude Python SDK (anthropic) is the purpose-built client for Python applications, and it owns the concerns you'd otherwise reimplement: authentication (defaults to the ANTHROPIC_API_KEY environment variable), typed response parsing, and automatic retries with exponential backoff for transient failures (rate limits, 5xx errors, connection issues), defaulting to two retries and honoring retry-after headers. It also raises typed exceptions (e.g., RateLimitError, AuthenticationError) rather than returning raw error JSON, so your application can handle failures programmatically.

The standard documented pattern is exactly the straightforward one: instantiate Anthropic() (the API key is read from the environment by default), then call client.messages.create(...). Using the SDK means your integration code focuses on the application's logic — prompt construction, handling the response, and business behavior — while the SDK maintains the transport layer, parsing, and retry policy consistently.

Why the other options are incorrect

- A — "Call the REST API directly with raw HTTP": Reimplements everything the SDK already provides (auth, retries, parsing, typed errors) and creates a maintenance burden with no benefit; the SDK is the documented integration path.

- C — "Use another provider's SDK and translate responses": Introduces a translation layer that adds fragility and complexity for no gain — you'd be fighting the wrong API shape and losing Claude-specific error semantics.

- D — "Embed Claude calls in shell commands invoked from Python": Moves the integration outside the Python process, losing typed errors, structured parsing, and retry handling — an ad-hoc approach that's harder to test, debug, and maintain.

The tested distinction: use the purpose-built SDK (managed auth, retries, parsing, typed errors) vs. raw HTTP, cross-provider translation, or shelling out.

References

- Claude Platform, Python SDK — installation, Anthropic() client with ANTHROPIC_API_KEY default, client.messages.create().

Question 23 Choose 1
A teammate has asked how the Claude SDK handles transient API errors, such as a temporary network issue or a brief rate-limit response. They want to know whether the application code needs to handle every transient error or whether the SDK provides any default behavior. How would you describe the SDK's default behavior?
Show answerHide answer

Correct answer: D The SDK provides default retry behavior for many transient errors, and the application code can configure or extend that behavior as needed.

Explanation

Explanation

The Claude Python SDK automatically retries many transient failures by default, and that behavior is configurable. According to the SDK's documented behavior:

- What is retried by default: connection errors, 408 (Request Timeout), 409 (Conflict), 429 (Rate Limit), and any 5xx error — including 529 (Overloaded). This directly covers the teammate's examples: a temporary network issue (connection error) and a brief rate-limit response (429) are both retried automatically.

- Default retry count: two retries, meaning up to three total attempts per call. Retries use exponential backoff with jitter and respect the server's retry-after header when present.

- Configurability: you can change this via max_retries on the client (e.g., Anthropic(max_retries=5) or max_retries=0 to disable) or per request with client.with_options(max_retries=...).

So the application does not need to hand-roll retry logic for every transient error — the SDK provides a sensible default — but teams can tune or extend it when their workload requires different behavior.

Why the other options are incorrect

- A — "Default retries up to a fixed number, not configurable": The retry count is configurable via max_retries at both client and per-request level. The "not configurable" claim is false.

- B — "Retries network errors but surfaces rate limits directly": Incorrect — 429 rate limits are explicitly retried by default in the Python SDK. The SDK does not force the application to implement its own rate-limit retry.

- C — "Logs and continues without retrying": The opposite of the documented behavior — the SDK retries automatically; it does not simply log and proceed without retrying.

The tested distinction: SDK has built-in, configurable default retries for transient errors (including network and rate limits) vs. fixed/non-configurable retries, no rate-limit retry, or no retry at all.

References

- Anthropic Python SDK README — "429 Rate Limit, and >=500 Internal errors are all retried by default"; max_retries configurable.

Question 24 Choose 1
A teammate has asked you to explain why the team's Claude application is billed for output tokens at a different rate than input tokens. They had assumed the rate was the same for both. How would you explain the difference?
Show answerHide answer

Correct answer: D Output tokens are typically billed at a higher rate than input tokens, and cost models for the application should reflect both rates separately.

Explanation

Explanation

The teammate's assumption is incorrect: Anthropic's pricing bills input and output tokens at different rates, and output is the more expensive half. Across current models, the pattern is consistent:

- Claude Sonnet 5: $2 per million input tokens and $10 per million output tokens .

- Claude Haiku 4.5: $1 per million input tokens and $5 per million output tokens .

- Claude Opus 4.6: $5 per million input tokens and $25 per million output tokens .

Output tokens typically cost about 5× the input rate . This is why a correct cost model must apply the two rates separately — the baseline formula is:

( input tokens ÷ 1M × input rate ) + ( output tokens ÷ 1M × output rate ) = request cost .

Because output drives a larger share of the bill per token, response length matters as much as prompt size when forecasting cost .

Why the other options are incorrect

- A — "Same rate; the difference is a billing error": Factually wrong — every current model publishes distinct input and output rates .

- B — "Output is billed at a lower rate": Reverses the actual relationship — output is higher, not lower .

- C — "Output tokens are not billed at all": Incorrect — output tokens are explicitly metered and priced in the published rate card .

The tested distinction: separate input and output rates, with output priced higher — so cost models must reflect both.

References

- Anthropic pricing pages — Sonnet 5 $2/$10, Haiku 4.5 $1/$5, Opus 4.6 $5/$25 per million input/output tokens .

That's the last free question

You've seen the free 30% (24 of 95 questions). Full access unlocks every question and full-length CCDV-F mock exams (53 questions, 120 minutes), a different mock on every attempt.

Unlock full mock exam
Full mock exam

Sit the CCDV-F exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real CCDV-F exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full CCDV-F mock exam
  • 53questions per mock
  • 120 mintime limit
  • 95questions in the bank
  • Newmock on every attempt