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?
Show Answer & Explanation
Correct Answer: B
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?
Show Answer & Explanation
Correct Answer: B
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?
Show Answer & Explanation
Correct Answer: D
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?
Show Answer & Explanation
Correct Answer: D
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?
Show Answer & Explanation
Correct Answer: C
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?
Show Answer & Explanation
Correct Answer: D
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?
Show Answer & Explanation
Correct Answer: D
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?
Show Answer & Explanation
Correct Answer: C
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?
Show Answer & Explanation
Correct Answer: A
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?
Show Answer & Explanation
Correct Answer: B
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
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.
More CCAR-F Practice Questions by Domain
- CCAR-F Practice Questions: Agentic Architecture & Orchestration — 27% of the exam
- CCAR-F Practice Questions: Tool Design & MCP Integration — 18% of the exam
- CCAR-F Practice Questions: Claude Code Configuration & Workflows — 20% of the exam
- CCAR-F Practice Questions: Context Management & Reliability — 15% of the exam
Want more? Take the free CCAR-F sample tests across all 5 domains, review the CCAR-F cheat sheet for last-minute revision, or read the Ultimate Guide to the CCAR-F certification.