CCAR-F: Claude Certified Architect - Foundations

CCAR-F: Claude Certified Architect - Foundations practice questions, page 3 of 6, with answer review and explanations.

Get the full CCAR-F practice test · 137 questions, PDF and online test engine

Question 11

You are building a customer support resolution agent using the Claude Agent SDK. The agent handles high-ambiguity requests like returns, billing disputes, and account issues. It has access to your backend systems through custom Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate. A customer contacts the agent about a warranty claim on a power drill. Resolving this requires multiple sequential tool calls: ‘get_customer’ to look up their account, ‘lookup_order’ to find the purchase details, and then either ‘process_refund’ or ‘escalate_to_human’ depending on warranty eligibility. You’re implementing the agentic loop that orchestrates these steps using the Claude API. What is the primary mechanism your application uses to determine whether to continue the loop or stop?

  1. You manually set the ‘tool_choice’ parameter to ‘“none”’ after the final expected tool call to force Claude to stop requesting tools.
  2. You check whether Claude’s response contains a text content block – if text is present, the agent has produced its final answer and the loop should exit.
  3. You track the number of tool calls made and exit the loop once a preconfigured maximum is reached.
  4. You check the ‘stop_reason’ field in each API response – the loop continues while it equals ‘“tool_use”’ and exits when it changes to ‘“end_turn”’ or another terminal value.

Answer: D. You check the ‘stop_reason’ field in each API response – the loop continues while it equals ‘“tool_use”’ and exits when it changes to ‘“end_turn”’ or another terminal value.

Explanation: The agentic loop is driven by the API response’s stop_reason. When Claude returns tool_use, the application executes the requested tool and sends the result back for the next turn. The loop ends when Claude returns a terminal stop reason such as end_turn, indicating that no further tool execution is required.

Question 12

You are integrating Claude Code into your Continuous Integration/Continuous Deployment (CI/CD) pipeline. The system runs automated code reviews, generates test cases, and provides feedback on pull requests. You need to design prompts that provide actionable feedback and minimize false positives. During initial testing of the automated review pipeline, you notice that reviews on large PRs (50+ changed files) sometimes take over 20 minutes and cost $8-12 per run due to extensive agentic loops – Claude reads files, runs analysis tools, and iterates many times. Your team needs each invocation to abort once it reaches a fixed iteration count and a fixed dollar amount, enforced by Claude Code itself rather than the surrounding job runner. Which configuration change directly enforces both of those per-invocation caps?

  1. Switch the ‘--model’ flag to a smaller, cheaper model so each iteration uses fewer tokens and lower per-call cost.
  2. Add ‘--max-turns 10 --max-budget-usd 2.00’ to the ‘claude -p’ invocation to cap iterations and spend.
  3. Set ‘--permission-mode dontAsk’ to auto-deny any tool permission requests not in the explicitly allowed set.
  4. Set ‘timeout-minutes: 5’ on the GitHub Actions job step and monitor per-run costs via the Anthropic Console usage dashboard.

Answer: B. Add ‘--max-turns 10 --max-budget-usd 2.00’ to the ‘claude -p’ invocation to cap iterations and spend.

Explanation: The --max-turns option places a hard limit on the number of agentic turns, while --max-budget-usd caps the amount Claude Code may spend during the invocation. Using both on the claude -p command directly enforces iteration and cost limits within Claude Code rather than relying on external CI timeout or monitoring mechanisms.

Question 13

You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JavaScript Object Notation (JSON) schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems. Your system has been running for 3 weeks and human reviewers have corrected 847 extractions. Analysis reveals a recurring pattern: when recipes use informal measurements like “a handful” or “a splash”, the model either invents specific amounts or leaves fields empty – accounting for 23% of all corrections. How should you use this feedback to improve extraction accuracy?

  1. Implement a post-processing layer that uses pattern matching to detect informal measurement phrases in source text and automatically populate values when the extraction is empty.
  2. Update your JSON schema to add a “measurement_type” enum field (precise/informal).
  3. Fine-tune the model on the 847 corrected extractions.
  4. Add few-shot examples to your prompt demonstrating correct handling of informal measurements – extracting them verbatim rather than converting or omitting them.

Answer: D. Add few-shot examples to your prompt demonstrating correct handling of informal measurements – extracting them verbatim rather than converting or omitting them.

Explanation: The reviewer corrections reveal a clear, recurring ambiguity that can be addressed directly through examples. Few-shot examples showing informal measurements preserved verbatim teach the model the desired behavior without requiring unnecessary schema changes or model fine-tuning.

Question 14

You are using Claude Code to accelerate software development. Your team uses it for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow with custom slash commands, CLAUDE.md configurations, and understand when to use plan mode vs direct execution. Your team has connected a custom MCP server that provides DevOps workflow templates. The server exposes several MCP prompts (such as ‘deploy_checklist’ and ‘incident_response’) in addition to tools. How do these MCP prompts become accessible within Claude Code?

  1. They are automatically prepended to every conversation as additional system-level context, influencing Claude’s behavior throughout the session.
  2. They are added to Claude Code’s tool registry alongside the server’s tools, invoked automatically by the model when relevant to the task.
  3. They appear as slash commands (e.g., ‘/mcp__servername__deploy_checklist’) that you can invoke, with arguments passed after the command name.
  4. They are surfaced as ‘@’-mentionable resources alongside files, fetched and attached to your message when referenced.

Answer: C. They appear as slash commands (e.g., ‘/mcp__servername__deploy_checklist’) that you can invoke, with arguments passed after the command name.

Explanation: MCP servers can expose reusable prompts that Claude Code discovers dynamically and surfaces as slash commands. These prompts use the /mcp__ __ naming format, and any text following the command can be passed as arguments to the prompt.

Reference: https://code.claude.com/docs/en/commands

Question 15

You are integrating Claude Code into your Continuous Integration/Continuous Deployment (CI/CD) pipeline. The system runs automated code reviews, generates test cases, and provides feedback on pull requests. You need to design prompts that provide actionable feedback and minimize false positives. After deploying automated code review, developers report that approximately 35% of flagged findings are false positives falling into consistent patterns: style suggestions contradicting team conventions, security warnings for patterns safe in your deployment context, and performance suggestions that would degrade your specific use case. You want to reduce false positives while maintaining the ability to catch genuine issues. Which approach best enables the model to generalize its judgment to novel code patterns it hasn’t seen before?

  1. Include few-shot examples in your prompt showing annotated code snippets that distinguish acceptable patterns from genuine issues in each category.
  2. Create a comprehensive written specification of all patterns that should not be flagged, then include this full documentation in the system prompt.
  3. Implement post-processing that uses keyword matching to filter out findings containing terms like “convention,” “context-dependent,” or “trade-off.”
  4. Add instructions to your system prompt to “be conservative,” “only flag definite issues,” and “consider that some patterns may be intentional.”

Answer: A. Include few-shot examples in your prompt showing annotated code snippets that distinguish acceptable patterns from genuine issues in each category.

Explanation: Few-shot examples teach the model the decision boundary between acceptable project-specific patterns and genuine defects. By showing representative positive and negative cases across style, security, and performance, the model can generalize those judgment criteria to new code patterns more effectively than relying on vague instructions or exhaustive rule lists.

Get the full CCAR-F practice test · 137 questions, PDF and online test engine