All Anthropic exams
Free CCAR-F practice test: 30 questions with answers
30 original questions for Claude Certified Architect - Foundations, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
- Real exam
- 60 questions, 120 min
- Passing score
- 720 on a 100-1,000 scaled score
All 30 CCAR-F questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Agentic Architecture & Orchestration (6 questions)
Question 1
A developer builds a loop around the Messages API. A response arrives with stop_reason set to 'tool_use'. What should the application do next?
- ARun the requested tool, then send a tool_result block that references the tool_use id in the next user message
- BShow the text blocks to the user and close the session, because the model has finished its turn
- CRestart the conversation from the system prompt and place the raw tool output inside the system field so the model reads it first
- DRemove the tool_use block from the history and resend the same request with a higher temperature to get a different response
Show answer and explanationHide answer
Correct answer: AA stop_reason of 'tool_use' means the model is waiting for a tool result, so the application runs the tool and returns a tool_result tied to the tool_use id, then calls the model again. Closing the session ends the loop too early, and restarting with tool output in the system field or changing temperature does not complete the exchange correctly.
Question 2
A research coordinator fans out work to three subagents that each investigate a different market segment. Which design keeps the coordinator's context manageable while still allowing it to synthesize the findings?
- AEach subagent returns a concise structured summary of its findings and cited sources, and the coordinator combines those summaries
- BThe coordinator forwards every raw web page it retrieved to the subagents and asks each one to echo the page back for confirmation
- CEach subagent returns its complete working transcript, including every search query, intermediate draft, and dead end, so the coordinator can audit each step
- DThe coordinator gives every subagent a copy of its own full message history so that no context has to be restated in the task prompts
Show answer and explanationHide answer
Correct answer: AConcise structured summaries keep the hub's context small while preserving findings and sources for synthesis. Full transcripts and raw pages flood the coordinator's context, and copying the whole history into each subagent wastes context on detail that most subagents do not need.
Question 3
A coordinator agent delegates work to specialist subagents. Which TWO practices help the coordinator keep reliable control of the overall workflow? (Choose two.)
- ARequire each subagent to return its results in a structured format that the coordinator can validate before using them
- BLet each subagent message the end user directly so that the coordinator never has to relay anything between them
- CPass the complete output of every other subagent into each new subagent's prompt so that all workers share the same facts
- DGive each subagent a bounded task with explicit inputs, a clear stopping condition, and a stated expected output shape
- EAllow subagents to call one another directly through shared tools so that the coordinator is only involved at the end
Show answer and explanationHide answer
Correct answer: A, DValidated structured returns and bounded tasks with explicit inputs keep the coordinator in control of each step. Letting subagents talk to users or to each other directly, or flooding every prompt with all other outputs, removes the coordinator's oversight and bloats context.
Question 4
A refund agent must confirm the customer's identity before it can issue any refund. The team has noticed the model sometimes skips verification when a customer sounds friendly. Which change enforces the rule most reliably?
- AAdd a sentence to the system prompt stating that the model must never issue refunds before verification is complete
- BHave the application block refund calls until a verification tool has returned success for that specific customer account
- CAsk the model to write in its reasoning that verification was completed before every refund call it makes in the conversation
- DLower the temperature setting so the model follows the verification instructions more consistently across all conversations
Show answer and explanationHide answer
Correct answer: BA check in application code cannot be talked around, so refunds stay blocked until the verification tool succeeds. Prompt sentences and self-reported reasoning are advisory and can be skipped, and temperature does not enforce any business rule.
Question 5
A developer has a long Claude Code session that reached a good point. She wants to test two different refactoring strategies from that same point while keeping each exploration's history separate. What is the best approach?
- AKeep both strategies in the current session and tell Claude to disregard the first approach once it starts working on the second one
- BFork the session from the shared point so that each strategy continues in its own branch with its own subsequent history
- COpen two brand-new sessions with no prior context and re-describe the codebase from scratch in the first message of each
- DPaste the whole transcript into CLAUDE.md so that both branches load it at startup and begin from the same understanding
Show answer and explanationHide answer
Correct answer: BForking creates a separate continuation from the shared point, so the two explorations do not contaminate each other while keeping the earlier context. Asking Claude to disregard earlier work is unreliable, while pasting transcripts into CLAUDE.md or starting fresh sessions either bloats instructions or throws away the shared context.
Question 6
A team must rename a widely used internal API across roughly 300 files in a large monorepo. Which task decomposition is most appropriate for an agent?
- ASplit the rename into independent per-module subtasks on a checklist, and verify each module's tests before the next one starts
- BSend the entire repository in one prompt and ask for every changed file back in a single response, with no intermediate checks or tests
- CAsk the agent to rename one function per hour and pause for a developer to approve each individual rename before the next one starts
- DRun a single find-and-replace across the whole repository with no per-module review, then fix any problems after the build breaks
Show answer and explanationHide answer
Correct answer: AIndependent subtasks on a checklist, each verified before the next begins, keep errors contained and make progress visible. Sending everything at once, pausing for every rename, or running an unreviewed bulk replace each fail in a way that makes errors hard to find or the work too slow.
Claude Code Configuration & Workflows (6 questions)
Question 7
A monorepo has a frontend folder and a database folder that follow different coding conventions. The team wants each set of conventions applied only when Claude is editing files in the matching folder. Which mechanism fits best?
- AOne long root CLAUDE.md that lists every convention for every folder, loaded in full on every single request
- BA separate custom slash command for each folder that developers must run before touching any file in that folder
- CShell environment variables exported on each developer's machine that switch conventions whenever they change into a folder
- DRule files under .claude/rules, each scoped with a path pattern so that it loads only for files in the matching folder
Show answer and explanationHide answer
Correct answer: DPath-scoped rule files load conventions only when Claude works in the matching area, which keeps context focused. A single large CLAUDE.md loads everything every time, slash commands depend on people remembering to run them, and shell variables on a developer's machine are not read as convention rules.
Question 8
A developer wants Claude Code to propose an approach for a risky change touching a dozen files, and to review that approach before any file is modified. Which mode should be used first?
- ADirect execution with auto-accept turned on, then reviewing the resulting diff with git afterward to catch any mistakes that were made
- BPlan mode, where Claude explores the code and proposes a plan without editing files until the developer approves it
- CA custom slash command that makes the edits on a temporary branch and deletes that branch automatically afterward
- DPrint mode with a JSON output format, so the proposed edits come back as structured data that can be inspected offline
Show answer and explanationHide answer
Correct answer: BPlan mode separates investigation and proposal from editing, so the developer can approve the approach before anything changes. Auto-accepting edits and reviewing afterward, or running a temporary-branch command, allows modifications before the approach has been reviewed.
Question 9
A team has a repeatable workflow that generates a changelog entry from recent commits. They want any teammate to run it by name from inside Claude Code. Which option fits best?
- AA line in CLAUDE.md asking Claude to write changelog entries whenever a teammate mentions commits anywhere in a conversation
- BA project slash command stored as a markdown file in the repository, so that teammates invoke it by typing its name
- CA personal global hook that runs a changelog script after every single tool call Claude makes in any project on the machine
- DA shell alias on one developer's laptop that pastes the prompt into the terminal each time it is typed
Show answer and explanationHide answer
Correct answer: BProject slash commands are markdown files committed to the repository, so every teammate can invoke them by name. A CLAUDE.md instruction is passive guidance rather than a named command, and hooks or personal aliases do not give the whole team a shared, invocable workflow.
Question 10
A CI job runs Claude Code to review pull requests, but the job stalls waiting for a permission approval that nobody can give. What is the most appropriate fix?
- AAdd a sixty-second pause before each call so that the approval prompt has time to appear and someone can answer it
- BRun Claude Code in non-interactive print mode, with the tools the job needs permitted in advance through its configuration
- CDelete the CLAUDE.md file from the repository, since its presence is what triggers the approval prompt inside the job
- DSwitch to the interactive session and have a developer watch the terminal log, answering each permission prompt as it appears, for every run
Show answer and explanationHide answer
Correct answer: BPrint mode runs non-interactively, so the permissions the job needs must be granted ahead of time rather than approved at a prompt. Pauses, interactive sessions, or deleting CLAUDE.md do not address the missing approval mechanism in an unattended pipeline.
Question 11
Which TWO statements about CLAUDE.md files in Claude Code are accurate? (Choose two.)
- AA project CLAUDE.md committed to the repository gives every teammate who clones it the same project instructions
- BCLAUDE.md is the only supported place where custom slash commands and skills can be defined for a project
- CInstructions in CLAUDE.md are enforced exactly as written, so a separate hook is never needed to back them up
- DA CLAUDE.md placed in a subdirectory can add guidance that applies when Claude works on files in that part of the tree
- ECLAUDE.md must be written as JSON with a schema, because Claude Code parses it into structured configuration fields
Show answer and explanationHide answer
Correct answer: A, DCommitted project files share instructions across the team, and nested CLAUDE.md files add guidance for their own directory. CLAUDE.md is context that guides behaviour rather than a guaranteed enforcement mechanism, custom commands and skills live in their own folders, and the file is plain Markdown rather than JSON.
Question 12
A developer asks Claude Code to make the date parser better, and the first result is poor. Which follow-up is the most effective refinement?
- AShare the failing test output and a concrete expected result for one input, then iterate on that single behaviour until the test passes
- BRepeat the same vague request several times, on the assumption that each new attempt will get a fresh chance at a better answer
- CAsk Claude to rewrite the entire parser in a single pass without any tests, then review the rewritten code by hand afterward
- DAdd more adjectives to the request, such as robust, elegant, and fully optimized, so the model raises its quality target
Show answer and explanationHide answer
Correct answer: AConcrete failing output and a specific expected result give Claude a verifiable target to iterate against. Repeating a vague request, rewriting everything without tests, or adding adjectives does not supply the feedback needed to converge.
Prompt Engineering & Structured Output (6 questions)
Question 13
A code review prompt reports many style nitpicks as bugs, which buries the real defects in noise. Which prompt change most directly reduces these false positives?
- ATell the model to be thorough and to report every possible concern it can find anywhere in the diff, including personal style preferences
- BRaise the output token limit so the model has room to explain each finding at greater length in the review it produces
- CDefine explicit criteria for a reportable bug, including severity levels and examples of non-issues the model should skip
- DAsk the model to rate its confidence from one to one hundred on each finding, then post all findings regardless of the score
Show answer and explanationHide answer
Correct answer: CExplicit, testable criteria with severity definitions and named non-issues tell the model what to exclude, which cuts false positives. Asking for thoroughness, longer output, or confidence scores that are still all posted does not narrow what counts as a bug.
Question 14
A pipeline needs a JSON object that matches a fixed schema for every document it extracts from. Which approach is the most reliable?
- AAsk in the prompt for valid JSON only, then parse whatever text comes back using a regular expression that extracts the braces
- BSet the system prompt to say the model is a JSON API that must never output prose, markdown, commentary, or any other text at all
- CRequest JSON inside a markdown code block, then strip the fence lines with a script before the output is parsed into records
- DDefine a tool whose input schema describes the required fields and types, then force the model to call that tool for each document
Show answer and explanationHide answer
Correct answer: DForcing a tool call whose input schema defines the fields makes the output follow the structure the pipeline expects. Requests in prose, regex extraction, or code-fence stripping leave the structure unenforced, and a persona instruction alone does not guarantee schema conformance.
Question 15
An extraction step returns a record that fails schema validation because a required field is missing. What is the best next step?
- AAccept the partial record silently and store it, on the reasoning that an incomplete record is better than no record at all
- BSend the validation error and the original document back to the model, ask for a corrected output, and cap the number of retries
- CStop the pipeline and wait for a person to correct every failing record by hand before continuing
- DDiscard the whole batch, start a new session from scratch, and rewrite the system prompt so that it covers every edge case imaginable
Show answer and explanationHide answer
Correct answer: BFeeding the specific validation error back with a bounded number of retries gives the model a targeted chance to fix the output without looping forever. Storing invalid records, discarding the batch, or halting for manual work at every failure ignores the feedback loop the pipeline can use.
Question 16
A company must classify 50,000 archived support tickets overnight. Nobody is waiting on any individual result, and cost matters more than speed. Which approach is most suitable?
- AThe Message Batches API, with each ticket sent as a request carrying its own custom ID and results collected later
- BA streaming connection held open for each ticket until the model has produced its complete classification for that ticket
- CSynchronous Messages API calls made one at a time in a loop, so that each ticket finishes before the next one begins processing
- DA single Messages request that places all 50,000 tickets together in one very large prompt, so the model can process the whole archive in one pass
Show answer and explanationHide answer
Correct answer: AThe Message Batches API suits large asynchronous workloads where latency per item does not matter and cost does, and custom IDs let each result be matched back to its ticket. One-at-a-time calls and per-ticket streams are slow, and one oversized prompt is unreliable and cannot return clean per-ticket results.
Question 17
Which THREE techniques help a prompt produce consistent, machine-parseable output? (Choose three.)
- ASpecifying an exact output schema with named fields and their expected types
- BIncluding two or three worked examples that show raw input mapped to the exact expected output format
- CRaising the temperature setting so that the wording of answers varies naturally from one call to the next
- DAsking for a long free-form paragraph and having a second model call convert that paragraph into the output
- EDefining a closed set of allowed category labels that the model must choose from for each classification
Show answer and explanationHide answer
Correct answer: A, B, EAn explicit schema, worked examples, and a closed label set all narrow the output space so results are consistent and parseable. Higher temperature increases variation, and a free-form paragraph followed by a second conversion step adds an unstructured stage that is hard to make reliable.
Question 18
An extraction prompt with two examples handles normal invoices well, but on invoices with no tax line it invents a tax amount. Which change is most likely to fix this?
- ALower the temperature so that the model becomes more conservative and less willing to guess at values it cannot see in the document
- BAdd an example in the prompt where the document has no tax line and the expected output records that field as null
- CAdd a sentence to the prompt telling the model that it must never invent values under any circumstances whatsoever
- DRemove the two existing examples, since examples in general make models over-fit and copy numbers from the examples
Show answer and explanationHide answer
Correct answer: BA worked example that shows the missing-field case teaches the model the exact output for absence, which the existing examples did not cover. A lower temperature, a bare prohibition, or removing the examples does not show the desired behaviour for missing data.
Tool Design & MCP Integration (6 questions)
Question 19
Two tools, lookup_customer and search_customers, both accept a free-text name. The agent keeps choosing search_customers even when it already has an exact customer ID. What is the best fix?
- AAdd the word 'important' to the description of lookup_customer so the model prioritizes it over the other tool
- BDelete search_customers from the agent's toolset entirely, even though some workflows still need partial-name lookups for customers
- CRewrite both descriptions to state what each tool returns, which input it expects, and when it should not be used
- DRaise the max_tokens limit so the model has more room to reason about which of the two tools is the correct choice
Show answer and explanationHide answer
Correct answer: CClear descriptions that state what each tool returns, the input it expects, and when to avoid it give the model the signals it needs to route correctly. Emphasis words and a higher token limit do not resolve the ambiguity, and removing a tool that some workflows still need breaks legitimate use.
Question 20
An MCP tool that fetches shipping rates fails because the upstream carrier API is unreachable. Which response follows the isError pattern so the agent can react sensibly?
- AReturn an empty result with isError set to false, so the agent does not treat the missing rates as a problem it must handle
- BReturn a normal successful result whose text content begins with the word ERROR, so the model reads the failure as ordinary output
- CThrow an unhandled exception that crashes the MCP server, so the client restarts it and retries the call automatically
- DReturn a result with isError set to true and a message that explains the failure and whether a retry may help
Show answer and explanationHide answer
Correct answer: DSetting isError to true with an informative message lets the agent recognise the failure and decide whether to retry or report it. Reporting success with an empty result, crashing the server, or hiding an error word inside normal content all keep the failure away from the agent's error handling.
Question 21
A team wants its issue-tracker MCP server available to every developer who clones the repository, with the same configuration for everyone. Where should the server be declared?
- AIn the CLAUDE.md file as a plain URL that the model is told to call directly whenever it needs to read an issue
- BIn each developer's personal user-level settings, with a note in the README asking teammates to copy the same entry manually
- CIn a project-scoped .mcp.json file committed to the repository, so every clone picks up the same server definition
- DIn a local-scoped entry that stays private to one developer's machine and is intentionally kept out of version control
Show answer and explanationHide answer
Correct answer: CA project-scoped .mcp.json committed to the repository shares one server definition with everyone who clones it. Personal settings and local scope keep the configuration private, and a URL in CLAUDE.md is not a registered MCP server, so the tools would not be available to the agent.
Question 22
An agent must list every file whose name matches test_*.py under the src directory before deciding which ones to open. Which built-in tool is the right fit for that step?
- ARead, to open each file under src and inspect its name, one file at a time, before deciding whether to keep it
- BGrep, to search the contents of every file under src for the literal text test_ and report the matching lines
- CEdit, to replace the text test_ with an empty string in each file so that the matching files become easier to find
- DGlob, to match file paths against the pattern test_*.py under src and return the matching paths
Show answer and explanationHide answer
Correct answer: DGlob matches file paths by pattern, which is exactly what locating test_*.py files requires. Read opens a file that is already known, Grep searches file contents rather than names, and Edit modifies files, so none of those fit the listing step.
Question 23
Which TWO practices make an MCP tool easier for an agent to call correctly? (Choose two.)
- AName each parameter clearly and state its format, units, and allowed values in the input schema and description
- BReturn raw database rows with internal column codes and no labels, so the response stays as compact as possible
- CCombine several unrelated operations into one tool that accepts a free-form action string chosen by the model
- DReport failures as flagged results with a message that says what went wrong and which step the agent could try next
- EGive the tool a deliberately generic name so the model discovers its purpose by trying it with several inputs
Show answer and explanationHide answer
Correct answer: A, DPrecise parameter descriptions and actionable error results help the agent call the tool correctly and recover from problems. Unlabelled raw output, free-form multi-purpose tools, and vague names all make correct selection and use harder.
Question 24
A document-intake agent has several extraction tools available, one per document type. Each intake step must end with a call to one of those extraction tools, never a plain text reply. Which tool_choice setting is the best fit?
- Aany, which forces the model to call one of the provided tools and still lets it choose the matching extraction tool
- Bnone, which stops the model from using any tools so that it answers with text that the application then parses itself
- Ctool with the name of a single extraction tool, which forces that one tool to be called even for documents of other types
- Dauto, which lets the model decide for each document whether a tool call is needed or whether a plain text reply is enough
Show answer and explanationHide answer
Correct answer: AThe any setting forces a tool call while letting the model pick the matching extraction tool for each document. Auto allows a plain text reply, none forbids tool use, and naming one tool would force the wrong extractor for other document types.
Context Management & Reliability (6 questions)
Question 25
During a long support chat, the customer's order number and the refund amount agreed earlier begin to drift in the model's replies. Which mitigation is most effective?
- AAsk the model to restate the figures in its own conversational words, so that replies sound more natural to the customer
- BShorten the system prompt to the bare minimum so that more of the context window remains free for the conversation history
- CKeep critical facts such as the order number and agreed amount in a structured block that is supplied again on every turn
- DTurn off the order lookup tool entirely, so the model stops receiving tool results that add noise and bulk to the context window over time
Show answer and explanationHide answer
Correct answer: CPinning critical facts in a structured block that is re-supplied each turn keeps them exact instead of relying on paraphrase or recall across a long conversation. Asking for restated figures, trimming the system prompt, or removing the lookup tool does not preserve the facts reliably.
Question 26
A customer-support agent must decide when to hand a conversation to a human. Which trigger is the most reliable basis for escalation?
- AThe customer's messages become noticeably angrier in tone, so the model escalates as soon as a sentiment score falls below a set level
- BThe conversation reaches a fixed token count, so the session is passed to a human agent to avoid running out of context space
- CThe customer explicitly asks for a person, or the request falls outside documented policy with no clear path to resolve it
- DAny message that mentions a refund is escalated automatically, regardless of the amount or whether policy already covers it
Show answer and explanationHide answer
Correct answer: CAn explicit request for a person, or a clear gap in documented policy, are observable conditions that justify a handoff. Sentiment scores are unreliable proxies, a token count has nothing to do with the customer's need, and escalating every refund mention ignores whether the case is already covered.
Question 27
A coordinator receives a timeout from one of three subagents that were searching different databases. Which content should that subagent's error report include so the coordinator can act on it?
- AOnly the single word failed, since the coordinator cannot make use of technical details and should not have to parse them
- BThe full stack trace and every raw log line from the subagent's process, so that nothing is lost and the coordinator can reconstruct events
- CA successful status with an empty results list, so the overall pipeline keeps running without any visible interruption
- DThe failure type, the step that failed, any partial results already gathered, and whether a retry is likely to succeed
Show answer and explanationHide answer
Correct answer: DStructured error context with the failure type, the failing step, partial results, and retry guidance lets the coordinator decide whether to retry, reroute, or report partial coverage. A bare failure word hides what was done, a fake success corrupts results, and a raw log dump buries the information the coordinator needs.
Question 28
An agent must answer questions about a 400-file legacy codebase across several sessions. Which strategy best manages context for the work?
- ALoad the entire codebase into the prompt at the start so that no question ever requires another file to be read
- BAsk a subagent to read every file, then pass the complete text of all 400 files back to the main agent so that nothing is missed
- CSearch with targeted queries, read only the files each question needs, and keep a notes file that cites the file paths
- DWrite a one-sentence summary of the codebase once and rely on that summary alone for every answer in later sessions
Show answer and explanationHide answer
Correct answer: CTargeted search plus a notes file with file references keeps context small while letting later sessions pick up where earlier ones stopped. Loading everything, returning all file text, or relying on one sentence either overflows the context or leaves out the detail needed to answer accurately.
Question 29
A synthesis agent reads three sources that give three different figures for the same market size, with different publication dates. The report must be useful and honest. What should it do?
- AReport each figure with its source and date, note the disagreement, and state which figure is better supported and why
- BReport the figure from the most recent source only, and drop the other two so the report reads cleanly for executives
- CAsk the synthesis step to pick whichever figure sounds most plausible based on its own general knowledge of the market
- DAverage the three figures and report the mean as the market size, since averaging smooths out errors that any single source might contain
Show answer and explanationHide answer
Correct answer: AKeeping each claim attached to its source and date, and flagging the disagreement, preserves provenance and shows the uncertainty. Averaging, silently keeping only the newest figure, or choosing by plausibility hides the conflict and presents guesses as fact.
Question 30
A support agent is asked to 'update the Smith account' and finds two customers with that surname and similar addresses. Which behaviour is best?
- AUpdate the account with the most recent activity, since the most active customer is most likely the one the requester means
- BPick the first match in the database and proceed with the change, then mention in the final summary that a different Smith with a similar address might have been affected
- CAsk the requester to confirm which account is meant, using a distinguishing detail such as the account ID or email, before any change
- DUpdate both accounts so that neither customer is missed, and let the requester undo whichever change turns out to be wrong
Show answer and explanationHide answer
Correct answer: CWhen the target is ambiguous and the action changes data, the agent should confirm the identity before acting rather than guess. Picking a match, updating both records, or relying on the requester to undo changes risks modifying the wrong record.
Want more CCAR-F questions?
The full bank has 112 questions with answers and explanations, as a PDF, an online practice exam, or both.
Both formats together. The best value.
Instant access after payment, with 90 days of updates. Checkout is on our store, AIExamCerts.