CCAR-P Advanced Agentic Architecture Practice Question
A team is building an agent that must call a payment provider's API. The API requires an idempotency key on every charge request, and the agent may retry a charge if a network error occurs mid-call. Which design correctly preserves financial correctness when retries happen?
⚠ Common exam trap
The trap here is assuming each retry needs a unique key to be distinguishable, when uniqueness per attempt is precisely what causes duplicate charges and defeats the idempotency contract.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Derive the idempotency key deterministically from the logical charge (for example, a hash of order ID and amount) and reuse that same key across all retries of that charge.
The idempotency key is the provider's contract for recognizing repeated attempts as one logical charge. Deriving it deterministically from stable charge attributes means every retry, even after a process restart or agent replan, presents the same key, so the provider returns the original outcome instead of charging again. This preserves correctness under at-least-once retry semantics without sacrificing resilience.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Generate a fresh idempotency key for each retry attempt so the provider can distinguish a retry from a genuinely new charge.
Why it's wrong here
A fresh key per retry is exactly wrong: the provider will treat each retry as a distinct charge, so a network error after a successful charge produces a duplicate. The idempotency key's entire purpose is to let the provider recognize repeated attempts as the same logical operation. This design turns a recoverable error into a double-billing incident.
- ✗
Disable automatic retries for charge calls and surface every network error to a human operator for manual reconciliation.
Why it's wrong here
Disabling retries avoids duplicates but makes the agent fragile: transient network errors, which are common, now require human intervention and stall the workflow. It also does not address correctness for any retry that a human later triggers. The idempotency key mechanism already solves the duplicate problem, so removing retries discards resilience without a corresponding correctness gain.
- ✗
Omit the idempotency key and instead check the account balance before each retry to see whether the charge already landed.
Why it's wrong here
Balance checks are racy and imprecise: concurrent charges, pending settlements, and fees make the balance an unreliable indicator of whether a specific charge succeeded. The provider's idempotency mechanism exists precisely because balance inspection cannot reliably answer that question. Omitting the key also violates the API contract, which may reject the request outright.
- ✓
Derive the idempotency key deterministically from the logical charge (for example, a hash of order ID and amount) and reuse that same key across all retries of that charge.
Why this is correct
A deterministic key ties every retry to the same logical charge, so the provider deduplicates repeats and returns the original result. Hashing stable fields such as order ID and amount means the key survives process restarts and agent replanning. This is the standard way to make an at-least-once retry loop behave as exactly-once at the provider boundary.
About these practice questions
Courseiva writes every CCAR-P question from scratch — 262 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCAR-P practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAR-P exam.