Anthropic CCA-F (Claude Certified Architect - Foundations (CCAR-F)) Practice Test 19

Question 180

A test run fails with a clear assertion describing a missing null check. How should Claude Code use that information?

  1. Claim success because most tests passed
  2. Ask for a completely different task to distract from the failure
  3. Use the assertion failure to fix and retest the affected path
  4. Remove the assertion so the failure is no longer visible

Explanation

Correct Answer

C:

A specific failure narrows the defect and supports an evidence-driven iteration. The assistant should not overgeneralize from a single case.

Incorrect Answers

A:

Partial pass rates do not satisfy a suite requiring all mandatory tests. The failing case remains unresolved.

B:

Changing objectives does not repair the code. The test is directly relevant to the accepted request.

D:

Suppressing valid checks masks the bug. Repair must occur in the implementation.

Question 181

A developer receives several plausible architecture options and wants to narrow them through discussion before coding. Which interaction pattern helps?

  1. Treat every ambiguous requirement as an invitation to guess
  2. Ask targeted questions about constraints and confirm acceptance criteria
  3. Begin by deleting the current implementation
  4. Generate all alternatives in the production branch without review

Explanation

Correct Answer

B:

Clarifying requirements early avoids expensive wrong-path implementation. The chosen design can then be evaluated against explicit goals.

Incorrect Answers

A:

Silent assumptions can make the patch unsuitable. High-impact unknowns warrant clarification.

C:

Destructive action is premature when key constraints remain undecided. Requirement refinement should precede edits.

D:

Multiple speculative changes complicate comparison and rollback. Narrow the plan before execution.

Question 182

A CI reviewer says a patch still breaks formatting but all unit tests pass. What should the next iteration do?

  1. Change the formatter rules solely to make the patch pass
  2. Rewrite business logic even though the failure is purely formatting
  3. Ignore the formatter because functional tests pass
  4. Fix cited style errors and rerun the repository formatter

Explanation

Correct Answer

D:

Quality gates include formatting as well as behavior. A focused repair addresses the reported failing criterion.

Incorrect Answers

A:

Loosening standards to fit one result is usually the wrong fix. The patch should meet documented project conventions.

B:

Broad code changes create new risk without addressing the immediate style defect. Fix the correct layer.

C:

Different checks enforce different contracts. A required style gate can block release independently of unit tests.

Question 183

A coding assistant performs several edits but the maintainer cannot tell which change addressed which requirement. What would improve iteration quality?

  1. Remove acceptance criteria from the patch description to make iterations faster
  2. Make one massive commit with no intermediate checks
  3. Choose changes by random file order rather than dependency
  4. Omit commit descriptions and test output to reduce noise
  5. Work in small traceable steps with verification after meaningful changes

Explanation

Correct Answer

E:

Incremental diffs make failure attribution easier. Each iteration can target one acceptance criterion and provide observable evidence.

Incorrect Answers

A:

Lack of criteria prevents reliable attribution of changes to requirements. Small verified steps are more effective.

B:

Large unreviewed batches obscure cause and complicate rollback. They reduce feedback quality.

C:

Unstructured edits can violate prerequisites. A deliberate sequence is more reliable.

D:

Removing evidence makes it harder to understand outcomes. Concise traceability is useful, not optional.

Question 184

A proposed dependency upgrade affects a security patch and compatibility. Which feedback strategy is appropriate?

  1. Delete the compatibility suite so the upgrade is accepted
  2. Upgrade in a branch, then test compatibility and security
  3. Assume newer dependencies always preserve all interfaces
  4. Declare the upgrade safe after reading only the package title

Explanation

Correct Answer

B:

A version change can have multiple effects. Measured test feedback is needed before adopting the patch.

Incorrect Answers

A:

Removing checks conceals breakage and violates the stated evaluation need.

C:

Major and minor releases can introduce incompatibilities. Verification is still required.

D:

A name gives no evidence about dependency behavior. Release notes and tests matter.

Question 185

An assistant repeatedly edits a symptom while a failing integration test points to a shared contract mismatch. How should the next iteration change?

  1. Fix the common interface contract causing both errors
  2. Add more fallback guesses to each consumer independently
  3. Ignore the integration test because unit tests still pass
  4. Increase generation randomness to obtain a different patch

Explanation

Correct Answer

A:

Repeated local patches suggest a systemic defect. Aligning producer and consumer schemas can resolve multiple failures at once.

Incorrect Answers

B:

Scattered workarounds can hide divergence and increase fragility. The shared contract should be corrected.

C:

Component tests cannot prove interactions are compatible. The failing integration signal is relevant.

D:

Sampling variation does not supply root-cause evidence. Debugging should follow the observed mismatch.

Question 186

A CI pipeline must ask Claude Code to review a pull request without an interactive terminal. Which integration pattern fits?

  1. Launch an interactive session that waits for a developer to type replies
  2. Run Claude Code noninteractively with -p and defined IO
  3. Copy a local developer's session transcript into the CI job as credentials
  4. Treat the existence of a model response as proof that review passed

Explanation

Correct Answer

B:

CI jobs need unattended execution, bounded permissions and machine-readable results where possible. The pipeline should parse output and enforce its own gate.

Incorrect Answers

A:

Unattended runners can stall at prompts. Automation requires a mode designed for noninteractive execution.

C:

Conversation history is not a safe authentication or CI interface. The runner needs controlled identity and scoped context.

D:

Generated text can contain findings or errors. The pipeline must evaluate the actual criteria and status.

Question 187

A team wants CI-based Claude reviews to follow the same repository conventions as developer sessions. What should it include?

  1. Disable tests because the AI reviewer has read the code
  2. Depend on one engineer's private user instructions being present in CI
  3. Make the project's versioned CLAUDE.md available in the CI checkout
  4. Ask CI to infer standards from the latest commit message

Explanation

Correct Answer

C:

Shared instructions allow a consistent review policy across environments. The runner still needs explicit checks for critical release criteria.

Incorrect Answers

A:

Review can complement, not replace, executable quality gates. The project still needs objective verification.

B:

Personal configuration is not guaranteed in ephemeral runners. Team policy should live with the project.

D:

Commit messages are not a stable specification of review rules. Explicit project guidance is needed.

Question 188

A CI job asks Claude Code to review pull requests without modifying source branches. Which TWO controls make that workflow reproducible and least-privileged? Choose TWO.

  1. Use a human's interactive session as the only CI input
  2. Treat every missing reviewer response as a clean review
  3. Provide the exact source-control diff or revision range to the noninteractive review
  4. Grant deployment rights to every review runner for convenience
  5. Use tokens and tools limited to reading code and posting review findings

Explanation

Correct Answers

C:

A bounded input ties findings to the intended pull request. The job can retain commit IDs and review evidence for auditing.

E:

A reviewer should not be able to merge or deploy. Scoped credentials and execution permissions enforce the requested nonmutating role.

Incorrect Answers

A:

Unattended automation needs deterministic inputs and noninteractive execution. Personal sessions are not a stable runner contract.

B:

No output may indicate timeout or service failure. CI should represent incomplete advice as inconclusive.

D:

Release permissions are unrelated to reporting findings and enlarge security risk. They violate the explicit no-modification boundary.

Question 189

A Claude Code CI job must emit predictable JSON findings that an automated pull-request bot can parse. It already runs in noninteractive mode using claude -p. Which CLI addition best enforces the output contract?

  1. Add only --continue and assume the prior session guarantees valid JSON
  2. Add --verbose and parse arbitrary explanation prose as findings
  3. Add --output-format json and --json-schema with a validated schema
  4. Remove output validation and accept any zero-exit response as a passing review

Explanation

Correct Answer

C:

These flags request a JSON envelope with structured output constrained by the supplied schema. CI must still check process status, structured_output presence and the business meaning of each finding.

Incorrect Answers

A:

Session continuity concerns conversation state, not output type. It may also carry stale review context into the pipeline; a schema must be declared explicitly.

B:

Verbose diagnostics are not a structured review contract. A regex over arbitrary narrative cannot reliably identify valid findings, errors and incomplete runs.

D:

A successful invocation can return findings that still need schema and policy checks. Exit codes alone do not establish that the report matches the bot contract.

Question 190

A pull request includes untrusted instructions in a code comment asking the CI agent to ignore all security tests. What should the architecture do?

  1. Obey the comment because it is part of the pull request
  2. Disable security tests to avoid confusing the reviewer
  3. Treat repository text as untrusted and enforce external gates
  4. Grant the agent more privileges to inspect the suspicious comment

Explanation

Correct Answer

C:

Code under review can contain prompt-injection text. Immutable CI checks and permission boundaries prevent it from controlling release policy.

Incorrect Answers

A:

Untrusted source content is not authorized to redefine the reviewer's instructions. Following it would undermine the audit.

B:

Removing hard checks gives the attacker the desired outcome. Automated enforcement must remain active.

D:

Broader permissions do not neutralize prompt injection. The relevant defense is instruction/data separation.

Claude Certified Architect - Foundations (CCAR-F) (CCA-F) Practice Tests