CCAR-F Prompt Engineering and Structured Output Practice Question
Exhibit
{
"messages": [
{
"role": "user",
"content": "Extract the name and date from this email: 'Hi John, let's meet on Oct 5th.' Respond only in JSON."
}
],
"system": "You are a data extractor. Always use the key 'person_name' and 'event_date'."
}Refer to the exhibit. The developer observes that Claude occasionally includes conversational filler before the JSON block. What is the most reliable way to ensure the output starts immediately with the JSON object?
⚠ Common exam trap
Candidates often suggest using system prompts or specific output instructions like 'do not include conversational text,' which are frequently ignored by the model, rather than using the structural prefill technique.
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
✓
Prefill the assistant response with the '{' character.
Prefilling the assistant's response is a powerful technique to force Claude to start its output with a specific character or string. By providing the opening brace of the JSON object in the assistant message, the model is constrained to continue the sequence as a valid JSON object, effectively eliminating any preceding conversational text or explanations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Include a strict JSON schema in the system prompt.
Why it's wrong here
While defining a schema helps Claude understand the data structure, it does not inherently prevent the model from adding conversational preambles. Claude may still include introductory text before the JSON block, requiring additional post-processing logic to extract the valid JSON from the full string returned.
- ✓
Prefill the assistant response with the '{' character.
Why this is correct
Starting the assistant's message with an opening curly brace forces the model to complete the JSON object immediately. This technical maneuver bypasses the model's tendency to explain its actions, ensuring that the very first character of the generated response is part of the structured data payload.
- ✗
Set the temperature to 0.0 for deterministic output.
Why it's wrong here
Reducing temperature to 0 makes the model more deterministic but does not explicitly forbid conversational headers. Even at zero temperature, Claude might consistently choose to include a polite introduction if it believes that is the most likely completion for a helpful assistant based on its training.
- ✗
Use a higher frequency penalty to avoid repetitions.
Why it's wrong here
Frequency penalties are designed to prevent the model from repeating the same tokens too often and have no impact on structural output or conversational fillers. Using this parameter to control the start of a response is an incorrect application of the tool and will not solve the issue.
About these practice questions
Courseiva writes every CCAR-F question from scratch — 271 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.