Courseiva

CCAR-F Prompt Engineering and Structured Output Practice Question

Exhibit

{"role": "user", "content": "Extract company name and ticker."}, {"role": "assistant", "content": "{\"company\": \"Anthropic\", \"ticker\": \"N/A\"}"}

Refer to the exhibit. You are using few-shot prompting to guide the model's extraction behavior. What is the purpose of including this specific interaction in your prompt?

⚠ Common exam trap

Candidates often focus only on positive examples in few-shot prompting, neglecting edge cases like missing or null data, which leads to unpredictable output when real-world data is imperfect.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

To define the expected output format and behavior for missing data points.

Providing a few-shot example that demonstrates how to handle missing information (e.g., 'N/A') is crucial for robust data extraction. It shows the model exactly how to maintain schema consistency when data is absent. Without such an example, the model might hallucinate values or skip fields, breaking the downstream JSON parser. This establishes a predictable pattern for handling nulls or missing attributes in your data pipeline.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    To reduce the number of tokens required for the actual extraction task.

    Why it's wrong here

    Few-shot examples actually increase token usage because they must be included in every API request. They are not used for token optimization but for behavior optimization. The trade-off is higher costs for significantly better accuracy and structural adherence, which is almost always worth it for mission-critical extraction tasks.

  • ✗

    To force the model to use a specific ticker symbol if it's missing.

    Why it's wrong here

    The example demonstrates explicitly that the model should use 'N/A' when a value is missing, not that it should invent a ticker. Forcing an arbitrary value would lead to data corruption. The example is designed to prevent hallucinations, not to encourage them by forcing the model to guess data.

  • ✓

    To define the expected output format and behavior for missing data points.

    Why this is correct

    This example explicitly teaches the model how to handle cases where the required information does not exist. It ensures consistency by setting a precedent for using 'N/A' as a null value, which is vital for schemas that require all fields to be populated to avoid errors in downstream data ingestion.

  • ✗

    To increase the temperature of the model for that specific prompt.

    Why it's wrong here

    Few-shot examples do not change the temperature of the model. Temperature is a request-level parameter set in the API call. The examples provide context to the model about the desired output style and structure, but they do not modify the fundamental mathematical operation of the model's token selection.

About these practice questions

One of 271 original CCAR-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Anthropic exam blueprint

This CCAR-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAR-F exam.