Skip to course content
Free LangChain course

LangChain for LLM Applications and RAG

Module 02 Knowledge Check

5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.

1. The system message is best used for…

2. Hard-coding a provider and model name throughout your app causes…

3. Prompt templates with variables are preferable to string concatenation because…

4. Inserting untrusted user text directly into a system prompt is risky because…

5. Setting max tokens too low typically produces…

---

Answer Key and Explanations

Check these only after attempting every question.

1. B - Durable role, constraints, and output expectations that apply to every turn

Stable instruction belongs in the system role; per-turn content belongs in user messages.

2. B - Painful migration when pricing, availability, or capability changes

Configure the model in one place. Provider choice is an operational decision that will change.

3. B - They make the prompt structure explicit, reviewable, and testable

A prompt you can diff and test is a prompt you can improve deliberately.

4. B - It lets user content override your instructions - prompt injection

Keep untrusted content in the user/content role and treat it as data, never as instruction.

5. B - Silently truncated output that looks complete but is not

Truncation mid-structure is a common cause of malformed JSON and half-finished answers.

Practical Check

Apply this module to your own work: complete the module activity for *Models, Messages, Prompts, and Provider Configuration*, then write one sentence naming what your result shows and one naming what it does not.

Strong Answer Pattern

A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.