CCAR-P Practice Question: Developer Productivity and Operational Enablement
A developer is building an internal tool that uses Claude to answer questions about a large codebase. They want to reduce hallucinations and ensure answers are grounded in the actual code. Which technique should they use?
⚠ Common exam trap
The trap here is assuming that a larger context window or fine-tuning can replace retrieval, when dynamic grounding requires fetching relevant content at query time.
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
✓
Use retrieval-augmented generation (RAG) by embedding the codebase and injecting relevant snippets into the prompt.
Retrieval-augmented generation retrieves relevant code snippets and includes them in the prompt, grounding the model's answers in actual code. This reduces hallucinations and keeps responses up-to-date as the codebase evolves. It is more scalable and cost-effective than fine-tuning or stuffing the entire codebase into the context window.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a larger context window to include the entire codebase in every prompt.
Why it's wrong here
Even the largest context windows cannot hold an entire large codebase, and doing so would be prohibitively expensive and slow. It also dilutes relevant information with irrelevant code. Retrieval is necessary to select the most pertinent snippets. Thus, this approach is impractical and inefficient for the scenario.
- ✗
Fine-tune the model on the entire codebase.
Why it's wrong here
Fine-tuning on a codebase is expensive, slow, and may not generalize well. It also risks overfitting and does not provide dynamic retrieval of current code. The codebase changes frequently, so a static fine-tune would become outdated. RAG is more suitable for dynamic, large knowledge bases because it retrieves up-to-date information at query time.
- ✗
Increase the model's temperature to encourage more creative answers.
Why it's wrong here
Higher temperature increases randomness and creativity, which is the opposite of what is needed for factual, grounded answers. It would likely increase hallucinations. For codebase Q&A, lower temperature is preferred to ensure deterministic and accurate responses. Therefore, this approach would degrade performance rather than improve grounding.
- ✓
Use retrieval-augmented generation (RAG) by embedding the codebase and injecting relevant snippets into the prompt.
Why this is correct
RAG grounds the model's responses in retrieved, factual content from the codebase. By embedding the code and retrieving relevant snippets, the prompt includes actual code context, which reduces hallucinations and improves accuracy. This is a standard technique for knowledge-intensive tasks and directly addresses the need for grounded answers.
About these practice questions
One of 262 original CCAR-P 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 →
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-P 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-P exam.