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 extraction pipeline processes restaurant menus and must output structured JSON with fields for item names, descriptions, prices, and dietary tags. Some menus use inconsistent formatting-prices as "$12" vs "12.00", dietary info as icons vs text. What's the most reliable approach?
Correct Answer: D
The most reliable architecture separates semantic interpretation from deterministic normalization. Claude is well suited to identifying that "$12" and "12.00" represent prices, or that a leaf icon represents a dietary classification. However, canonical conversion-removing currency symbols, converting values to decimal types, mapping icons to controlled labels, and enforcing locale-specific rules-is more predictably performed in application code. Structured Outputs guarantee that Claude returns valid JSON matching the supplied schema, but that guarantee concerns structural conformance. It does not by itself guarantee that every semantically equivalent source representation will be normalized identically. Anthropic's evaluation guidance identifies code-based checks as the fastest, most reliable, and most scalable mechanism for rule-based validation. ( https://platform. claude.com/docs/en/build-with-claude/structured-outputs ) Option D therefore minimizes model responsibility: Claude extracts the evidence as represented, and deterministic post-processing converts it into the canonical downstream format. This also makes normalization rules independently testable, version-controlled, and auditable. Option A increases latency and cost without solving normalization. Option B improves output structure, but prompt-based normalization can still vary across ambiguous formats. Option C introduces unnecessary stochasticity and majority-vote logic where explicit parsing rules are available. The downstream contract should remain stable, but format conversion should be implemented using deterministic transformations rather than repeated probabilistic inference. Official references/topics: Structured Outputs-schema compliance; Evaluation Design-code-based validation; Reliable extraction pipelines.
CCAR-F Exam Question 27
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers. An engineer asks your agent to identify untested code paths in a legacy payment processing module spanning 45 files. After reading the first 8 source files, the agent's responses are becoming noticeably less accurate-it' s forgetting previously discussed code patterns and hasn't yet located all test files or traced critical payment flows. What's the most effective approach to complete this investigation?
Correct Answer: A
The investigation contains several bounded research questions that can be delegated independently: locating the complete test suite, tracing payment and refund flows, identifying conditional branches, and mapping external dependencies. Each subagent can read the relevant files in its own context and return a focused summary to the coordinating agent. Anthropic recommends subagents for codebase exploration because extensive file reading rapidly consumes the main context window. Subagents isolate that volume and return only their conclusions, preserving the main conversation for synthesis and implementation. ( https://docs.anthropic.com/en/docs/claude-code /common-workflows ) Anthropic also describes parallel research as appropriate when separate investigation paths can proceed independently and the main agent can synthesize the results afterward. ( https://docs. anthropic.com/en/docs/claude-code/sub-agents ) Option B sacrifices the current conversational state and requires reconstruction after /clear . Option C may reduce token usage, but isolated text matches cannot reliably reveal full execution paths, indirect calls, or test coverage relationships. Option D converts the current analysis into a single lossy summary and risks omitting details needed later. Option A directly addresses the demonstrated context degradation while retaining a high-level coordinating thread. The subagent prompts should be narrowly scoped and require concrete outputs such as file paths, uncovered branches, call-chain evidence, and existing tests associated with each flow. Official references/topics: Subagent Context Isolation; Parallel Research; Context Preservation; Coordinated Codebase Analysis.
CCAR-F Exam Question 28
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. The system routes documents with extraction confidence below 85% to human review. A quarterly audit reveals that 12% of high-confidence extractions (#85%) also contain errors-cases where the model finds plausible-but-incorrect values. Error sources vary: comparison tables showing competitor specs, appendices referencing different product variants, and ambiguous phrasing the model misinterprets. You need a sustainable strategy to catch these high-confidence errors and measure whether improvements reduce the error rate over time. What approach is most effective?
Correct Answer: D
Stratified random sampling provides both an ongoing quality-control mechanism and an unbiased measurement framework. By reviewing a fixed proportion of high-confidence outputs across meaningful strata-such as document type, field, source format, and business risk-the organization can estimate the residual error rate, compare performance across releases, and discover failure patterns that were not anticipated when existing rules were designed. Anthropic recommends measurable success criteria and evaluations that mirror the real-world task distribution, including edge cases. Evaluation volume and repeatability are important because improvements must be demonstrated empirically rather than inferred from isolated examples. ( https://docs.anthropic.com/en /docs/build-with-claude/develop-tests ) A weekly sampling program creates a stable benchmark and allows confidence intervals, trend analysis, regression detection, and error-taxonomy updates. Option A detects only disagreements between stochastic extractions. Two attempts may produce the same plausible but incorrect answer, so agreement is not equivalent to factual correctness. Option B addresses known patterns but will miss new failure modes and may generate excessive false positives. Option C actually lowers the review threshold in the wrong direction: documents between 70% and 85% would be treated as automated rather than reviewed if the routing rule remains "below threshold," and changing thresholds alone does not measure high-confidence error prevalence. Official references/topics: Evaluation Design; Representative Test Distributions; Continuous Reliability Measurement; Human-in-the-Loop Sampling.
CCAR-F Exam Question 29
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. You've asked Claude Code to build a PDF report generation feature. The initial implementation queries the database correctly, but the output has formatting issues: table columns are too narrow causing content truncation, dates display without proper formatting, and page break handling is incorrect. You've noticed these issues interact-changing column widths affects how dates render, and page breaks depend on content height. What's the most effective approach for iterating toward a working solution?
Correct Answer: C
The defects are coupled, so changing all three simultaneously would make it difficult to determine which modification caused an improvement or regression. Option C establishes a controlled sequence: correct the foundational column geometry, verify the resulting layout, format dates within the stabilized columns, and finally tune page breaks using the resulting content heights. Anthropic recommends tight feedback loops and early course correction. It also advises supplying Claude with an executable or observable verification mechanism, such as a test, build result, generated fixture, or screenshot comparison. Claude can then make a focused change, inspect the output, and iterate until that specific condition is satisfied. ( https://code.claude.com/docs/en/best-practices ) Option A discards useful context from the functioning database implementation. Option B changes multiple interacting variables in one pass, making failures harder to isolate. Option D provides a useful visual target but does not replace precise technical constraints or incremental verification. Each stage should have explicit acceptance criteria-for example, minimum column widths, expected date strings, and page-break fixtures using short and long content. Once a stage passes, its test becomes a regression guard for subsequent changes. Official references/topics: Incremental Refinement; Tight Feedback Loops; Observable Verification; Regression Control.
CCAR-F Exam Question 30
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. You're implementing a complex graph traversal algorithm with specific performance requirements and edge cases to handle (disconnected nodes, cycles, weighted edges). You want to structure your workflow for efficient iterative refinement with Claude. What approach will most effectively enable progressive improvement across multiple iterations?
Correct Answer: C
Option C creates an objective verification loop. The tests encode expected traversal behavior for disconnected graphs, cycle handling, weighted edges, invalid inputs, and performance constraints. Claude can implement the algorithm, execute the suite, inspect concrete failures, and refine the implementation until the measurable conditions pass. Anthropic emphasizes giving Claude a verification mechanism such as tests, builds, linters, or fixture comparisons. Without an executable pass-or-fail check, Claude can only determine that an implementation appears complete. With tests, it can perform work, evaluate the result, and iterate using evidence rather than subjective judgment. Anthropic also recommends reproducing defects with failing tests before applying corrections. ( https://code.claude.com/docs/en/best-practices ) Option A may produce a thoughtful initial design but does not guarantee progressive improvement after implementation. Option B risks inheriting assumptions or deficiencies from a reference that may not match the project's constraints. Option D depends on manual review and converts the developer into the primary verification system. The test suite should include correctness fixtures, boundary cases, complexity-sensitive workloads, and regression tests added whenever a new failure is discovered. This makes every iteration cumulative: a correction must satisfy the new case without breaking previously validated behavior. Official references/topics: Executable Verification; Test-Driven Iteration; Feedback Loops; Regression Testing.