FlashGenius Logo FlashGenius
Login Sign Up

CCAR-F Practice Questions: Prompt Engineering & Structured Output Domain

Test your CCAR-F knowledge with 10 practice questions from the Prompt Engineering & Structured Output domain. Includes detailed explanations and answers.

CCAR-F Practice Questions

Master the Prompt Engineering & Structured Output Domain

Test your knowledge in the Prompt Engineering & Structured Output domain with these 10 practice questions. Each question is designed to help you prepare for the CCAR-F certification exam with detailed explanations to reinforce your learning.

Question 1

A procurement system classifies contract termination reasons. Known categories are convenience, breach, and insolvency, but new legitimate reasons occasionally appear. Some contracts contain no termination clause. The system must preserve unknown reasons without inventing data. Which schema design is BEST?

A) Require a free-text reason string for every contract and describe the preferred category names in the field documentation.

B) Use a nullable category enum containing convenience, breach, insolvency, and other; require detail when other is selected.

C) Require an enum containing only convenience, breach, and insolvency, then map unrecognized language to the nearest category.

D) Make both category and detail optional free-text fields, allowing the model to populate either field when appropriate.

Show Answer & Explanation

Correct Answer: B

Explanation:

Correct answer (B): A nullable enum represents contracts with no supported reason, while an other category plus conditional detail preserves legitimate reasons outside the known taxonomy. The underlying CCAR-F principle is to use schemas deliberately for constrained values, missing states, and extensibility. In production, this design supports reliable downstream processing without forcing unsupported or lossy classifications.

Why the other options are wrong:
- Option A: Free text can preserve unexpected reasons, but requiring it for every contract encourages invented values and weakens category consistency.
- Option C: A closed enum simplifies downstream analytics, but nearest-category mapping loses meaning and can misclassify legitimate unexpected reasons.
- Option D: Optional free-text fields offer flexibility, but they do not reliably distinguish known categories, absent evidence, and unexpected valid values.

Question 2

A payment platform uses Claude Code to review changes across API handlers, a shared currency library, and database migrations. The review must detect both local implementation defects and cross-file contract mismatches. An independent reviewer is required to reduce bias from the initial analysis. Which architecture BEST satisfies these requirements?

A) Use one instance for the entire repository, then ask it to reconsider its own findings in the same context.

B) Run per-file analysis passes, then give their outputs and relevant diffs to a separate instance for cross-file review.

C) Assign each file to an independent instance and merge all findings without any repository-level integration pass.

D) Run one cross-file review first, then use the same instance to rewrite low-confidence findings more assertively.

Show Answer & Explanation

Correct Answer: B

Explanation:

Correct answer (B): Per-file passes identify localized defects, and a separate reviewer can integrate those findings to detect interface mismatches without inheriting the initial instances' exact reasoning context. The underlying CCAR-F principle is that independent review offers stronger separation than immediate self-review, while layered passes address different defect scopes. In production, this improves detection of both implementation errors and system-level inconsistencies.

Why the other options are wrong:
- Option A: A repository-wide view can detect integration issues, but self-review in the same context does not provide the required independence.
- Option C: Independent per-file reviews can detect local defects, but merging without integration analysis can miss cross-file contract mismatches.
- Option D: A cross-file pass is useful, but reusing the same instance and increasing assertiveness does not create independent verification.

Question 3

A CI service exposes `submit_review` and `lookup_policy` tools to Claude. Its parser accepts a successful review only when Claude calls `submit_review` with schema-conforming findings. Claude must not answer with free text or finish by calling only `lookup_policy`. Which configuration is MOST appropriate?

A) Use automatic tool choice and state in the prompt that structured output is preferred.

B) Remove all tool definitions and request a JSON object inside a Markdown code block.

C) Require any tool call and let the parser treat either available tool as the final response.

D) Force the named submit_review tool and define its required fields in the input schema.

Show Answer & Explanation

Correct Answer: D

Explanation:

Correct answer (D): Because every successful response must use one designated tool, the architect should force `submit_review` and define its input contract explicitly. The CCAR-F principle is that automatic selection does not guarantee a call, while requiring any tool does not guarantee the correct tool. In production, forcing the designated tool provides a predictable integration boundary, although semantic validation is still necessary.

Why the other options are wrong:
- Option A: Automatic selection gives Claude discretion and therefore cannot guarantee the required `submit_review` call.
- Option B: Prompted JSON does not enforce the required tool-mediated response mechanism.
- Option C: Requiring any tool permits Claude to call `lookup_policy` without producing the final review payload.

Question 4

Claude generates a six-file change to a billing service and then reviews its own output in the same conversation. The review catches local syntax issues but repeatedly misses inconsistent currency handling across files. Review independence is required, and uncertain findings must be routed to a human. Which architecture BEST improves reliability?

A) Extend the original conversation so the generator can reconsider each file while retaining all of its assumptions.

B) Run separate per-file reviews only and automatically reject every finding reported with low confidence.

C) Ask the original instance for a longer self-critique and combine all files into one unstructured response.

D) Use a fresh reviewer for focused per-file passes, then run a cross-file pass with confidence-based human routing.

Show Answer & Explanation

Correct Answer: D

Explanation:

Correct answer (D): A fresh reviewer provides greater independence from the generator's assumptions, while local and cross-file passes detect different classes of defects. Confidence reporting then supports human escalation for uncertain findings. This applies the CCAR-F principle of separating generation from evaluation and combining focused with integration-level review. In production, the architecture reduces shared blind spots and improves detection of cross-file consistency failures.

Why the other options are wrong:
- Option A: Retaining the original context also preserves assumptions and blind spots that caused the omissions.
- Option B: Per-file review cannot reliably detect inconsistencies spanning files, and low-confidence findings should be routed rather than automatically rejected.
- Option C: A longer self-critique still lacks independence, while an unstructured response weakens downstream routing.

Question 5

Claude extracts maintenance records into schema-valid JSON. A business-rule validator finds that service_end is earlier than service_start and that equipment_class conflicts with the source heading. Both errors appear correctable from the supplied record. What should the application do NEXT?

A) Accept the JSON because schema validation succeeded, then flag both fields for later analytics cleanup.

B) Repeat the original extraction prompt unchanged until a different answer passes the business rules.

C) Retry with the source context and specific field-level validation failures, then validate the corrected result again.

D) Remove the conflicting fields from the schema so that subsequent extraction attempts cannot fail validation.

Show Answer & Explanation

Correct Answer: C

Explanation:

Correct answer (C): A corrective retry should retain the source and tell Claude exactly which semantic constraints failed before validating the revision. The underlying CCAR-F principle is that validation must extend beyond syntax and that specific feedback enables targeted self-correction. In production, this makes retries more efficient and prevents schema-valid but operationally inconsistent records from propagating.

Why the other options are wrong:
- Option A: Schema validity confirms structure, but it does not establish chronological or source-level semantic correctness.
- Option B: An unchanged retry might produce variation, but it gives Claude no actionable information about what must be corrected.
- Option D: Removing fields may avoid validation failures, but it discards required data rather than correcting recoverable errors.

Question 6

A pull request changes authentication logic across eight files. Per-file reviews identify local defects but miss an inconsistent token-lifetime assumption between the API and worker. The same Claude instance also tends to approve conclusions from its first pass. The team requires an independent assessment, system-level analysis, confidence values, and deduplicated comments. Which design BEST satisfies these requirements?

A) Use one instance for per-file review, then ask it to shorten and rank its own findings.

B) Replace per-file analysis with one repository-wide pass and publish every observation independently.

C) Run the same per-file prompt twice in one session and merge identical findings as high confidence.

D) Use focused per-file passes, a separate reviewer instance, and a cross-file consolidation pass with confidence.

Show Answer & Explanation

Correct Answer: D

Explanation:

Correct answer (D): Focused passes preserve local review quality, a separate instance provides greater independence, and a cross-file consolidation pass detects integration issues while assigning confidence and removing duplicates. The underlying principle is to separate generation from independent review and combine local with system-level analysis. This matters in production because self-review can preserve initial blind spots, while unconsolidated multi-pass output creates duplicate noise.

Why the other options are wrong:
- Option A: Ranking and summarization can improve usability, but the same instance is not an independent reviewer and may preserve its initial assumptions.
- Option B: A repository-wide pass can identify interactions, but eliminating focused analysis may miss local details, and publishing every observation creates duplicate noise.
- Option C: Repeated passes may reveal variability, but a shared session can retain context, and identical answers do not establish independent correctness.

Question 7

A payment-service pull request changes authorization checks in four files. File-by-file Claude reviews find local issues but miss that a renamed claim is produced in one module and consumed under its old name in another. The team also requires an independent check before blocking a release. Which review architecture BEST satisfies these requirements?

A) Run one larger per-file review for each file and block the release on every reported finding.

B) Ask the original reviewer to reread its own findings and increase confidence when they remain unchanged.

C) Replace file reviews with one repository-wide pass and accept every issue above a fixed confidence threshold.

D) Combine focused file passes, a cross-file integration pass, and a separate reviewer instance with confidence reporting.

Show Answer & Explanation

Correct Answer: D

Explanation:

Correct answer (D): Focused passes preserve strong local analysis, while a cross-file integration pass can detect producer-consumer mismatches. A separate reviewer instance provides a more independent check than asking the original instance to reassess itself, and confidence reporting supports triage. The CCAR-F principle is to combine specialized passes with independent review for complementary coverage. In production, this improves detection reliability without treating self-review as independent verification.

Why the other options are wrong:
- Option A: Larger isolated file reviews still cannot reliably expose the described cross-module mismatch.
- Option B: Self-review can catch some mistakes, but the same instance may retain its original assumptions and does not meet the independence requirement.
- Option C: A repository-wide pass can detect interactions, but discarding focused passes reduces local specialization, and a confidence threshold is not independent review.

Question 8

A CI reviewer flags every unhandled exception as a release-blocking defect, even when an application framework intentionally catches the exception at a documented boundary. The response must remain structured as an array of findings. Which prompt revision BEST calibrates the reviewer while preserving broad defect detection?

A) Add ten examples of release-blocking unhandled exceptions that use different programming languages.

B) Instruct Claude to lower the severity of every exception-related finding by one level.

C) Add contrastive boundary examples, retain observable severity criteria, and show the required finding structure.

D) Remove exception findings from scope and rely on runtime monitoring to detect related failures.

Show Answer & Explanation

Correct Answer: C

Explanation:

Correct answer (C): Contrastive examples should show both a genuinely unhandled failure and an exception intentionally handled at a documented boundary. They should reinforce observable severity criteria and use the required output structure. The CCAR-F principle is that varied boundary examples calibrate decisions better than repetitive positive examples, while written criteria remain authoritative. In production, this reduces false positives without creating a blind spot for real exception defects.

Why the other options are wrong:
- Option A: Language diversity broadens syntax coverage, but positive examples alone do not teach the boundary between handled and unhandled exceptions.
- Option B: A blanket downgrade ignores actual impact and could understate genuinely release-blocking failures.
- Option D: Excluding all exception findings would remove noise but also prevent detection of legitimate defects within the reviewer's scope.

Question 9

Claude generates a database migration and then reviews it within the same conversation. Post-deployment analysis shows that the review often repeats the generation step's incorrect assumptions. The organization requires an independent review before a human approves the migration. Which architecture BEST satisfies this requirement?

A) Send the migration, requirements, and review criteria to a fresh model instance that returns structured findings with evidence.

B) Extend the original conversation and ask the same instance to reconsider every assumption before producing its review.

C) Increase the original instance's context window so it can retain more details from the migration-generation process.

D) Have the original instance assign confidence scores to its own findings and send only low-confidence items to a human.

Show Answer & Explanation

Correct Answer: A

Explanation:

Correct answer (A): A fresh reviewer instance receives the artifact and governing criteria without inheriting the generator's conversational trajectory, providing stronger review independence. The underlying CCAR-F principle is to separate implementation and evaluation roles when independent review is required. In production, this reduces correlated blind spots, while structured evidence makes findings easier for humans and automated systems to assess.

Why the other options are wrong:
- Option B: Explicit reconsideration can improve self-review, but the same instance and conversation can retain the assumptions the independent check must challenge.
- Option C: More context can improve recall, but it does not create independence and may reinforce prior reasoning.
- Option D: Confidence can aid prioritization, but self-reported confidence neither supplies independent review nor reliably detects shared blind spots.

Question 10

A team uses Claude Code in CI to review pull requests. Developers complain that the reviewer reports harmless formatting preferences, speculative risks, and inconsistent severity labels. The team wants findings limited to defects supported by evidence in the changed code. Which prompt change is MOST appropriate?

A) Ask the reviewer to find every possible issue and let developers dismiss low-value findings.

B) Define report, skip, evidence, and severity criteria, with examples at the decision boundaries.

C) Ask the reviewer to focus on serious issues while independently deciding what serious means.

D) Increase the response token limit so the reviewer can explain every observation in detail.

Show Answer & Explanation

Correct Answer: B

Explanation:

Correct answer (B): Defining explicit report and skip criteria tells the reviewer which observations qualify as findings, while evidence requirements and calibrated severity definitions reduce speculation and inconsistency. The underlying principle is that production prompts should make decision boundaries explicit rather than delegate undefined judgments to the model. This matters in CI because predictable, actionable findings preserve developer trust and reduce review noise.

Why the other options are wrong:
- Option A: This may maximize recall during exploratory auditing, but it preserves the false-positive burden the team needs to reduce.
- Option C: This prioritizes important defects in principle, but the undefined meaning of serious permits inconsistent severity judgments.
- Option D: More output space can improve explanations, but it does not define which observations should be reported or skipped.

Ready to Accelerate Your CCAR-F Preparation?

Join thousands of professionals who are advancing their careers through expert certification preparation with FlashGenius.

  • ✅ Unlimited practice questions across all CCAR-F domains
  • ✅ Full-length exam simulations with real-time scoring
  • ✅ AI-powered performance tracking and weak area identification
  • ✅ Personalized study plans with adaptive learning
  • ✅ Mobile-friendly platform for studying anywhere, anytime
  • ✅ Expert explanations and study resources
Start Free Practice Now

Already have an account? Sign in here

About CCAR-F Certification

The CCAR-F certification validates your expertise in prompt engineering & structured output and other critical domains. Our comprehensive practice questions are carefully crafted to mirror the actual exam experience and help you identify knowledge gaps before test day.