CCAR-F Prompt Engineering and Structured Output Practice Question
Which of the following describes the 'Sandwich' prompting technique?
⚠ Common exam trap
Candidates often think 'Sandwich' prompting means placing instructions only at the very beginning of the prompt or repeating them uniformly throughout every paragraph.
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
✓
Placing the prompt instructions before and after the main content.
Sandwich prompting involves placing instructions at both the beginning and the end of the input context. This is highly effective because it helps the model maintain focus on the instructions even when processing very long documents, where 'lost in the middle' phenomena often occur. This architectural pattern is a critical strategy for ensuring high-quality, instruction-compliant output in long-context, enterprise-scale language processing workflows.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Placing the prompt instructions before and after the main content.
Why this is correct
Sandwich prompting reinforces the model's focus by framing the content with instructions. By repeating key guidelines at the end, you ensure the model carries those constraints through the entire context window, significantly reducing the likelihood of the model forgetting its task when dealing with extensive input documents.
- ✗
Mixing multiple tasks in a single sandwich-style prompt.
Why it's wrong here
Mixing tasks is the opposite of good prompt design, as it leads to confusion and task failure. Sandwich prompting refers to placement of instructions relative to data, not the interleaving of disparate tasks. Clear, focused prompts are always superior to complex, multi-task prompts for maintaining model performance.
- ✗
Using only few-shot examples without any system instructions.
Why it's wrong here
Few-shot examples are helpful, but they cannot replace a core system instruction. A lack of system instructions leaves the model without a guiding persona or strict constraints, leading to unpredictable behavior. Sandwich prompting specifically refers to the placement of instructions, not the reliance on examples alone.
- ✗
Formatting the entire prompt output as a JSON sandwich.
Why it's wrong here
This describes a formatting style rather than a prompting technique. Sandwich prompting is about managing instruction attention in the context window. While you might output JSON, the term 'sandwich' refers to the strategic placement of prompts to improve model focus, not the structure of the resulting JSON output.
About these practice questions
This CCAR-F question is part of Courseiva's 271-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.