Prompt & Context Engineering interview questions

25 questions from the Prompt & Context Engineering course, each with the correct answer and an explanation. Try to answer before you open the answer.

From Prompts to Context

1. What does context engineering add beyond prompt wording?

  1. Training the model weights
  2. Choosing a nicer font
  3. Deciding which content enters the window, in what order, structure and budget
  4. Raising the temperature
Show answer

Answer: Deciding which content enters the window, in what order, structure and budget

The assembled input decides what the model can know on that call.

Lesson: What Context Engineering Means

2. What counts against the context window?

  1. Input tokens and the generated output tokens
  2. Only the user's question
  3. Only the system prompt
  4. Only images
Show answer

Answer: Input tokens and the generated output tokens

Reserve room for the answer as well.

Lesson: Tokens and the Context Window

3. Which block should be treated as untrusted?

  1. Your fixed examples
  2. Your own reviewed system rules
  3. Your tool definitions
  4. Retrieved documents and tool results
Show answer

Answer: Retrieved documents and tool results

Content from outside your code may contain anything, including instructions.

Lesson: Anatomy of a Model Request

Budgeting the Window

4. What should normally never be trimmed?

  1. Low-scoring documents
  2. The system rules and the current question
  3. Very old history turns
  4. Extra examples
Show answer

Answer: The system rules and the current question

Trim the least valuable content first.

Lesson: Allocating a Token Budget

5. Why can a much longer context hurt answers?

  1. Models refuse long inputs always
  2. Relevant facts get buried among distractors, and cost and latency rise
  3. Long inputs change the model weights
  4. Tokens become free
Show answer

Answer: Relevant facts get buried among distractors, and cost and latency rise

Send the smallest highly relevant set.

Lesson: Why Longer Context Is Not Always Better

6. A response stopped because it hit the length limit. What is true?

  1. It means the input was empty
  2. It is always complete
  3. It means the model refused
  4. It may be incomplete and should be handled, not used as final
Show answer

Answer: It may be incomplete and should be handled, not used as final

Check the stop reason before trusting the output.

Lesson: Reserving and Controlling Output

Selecting What Goes In

7. Why use a minimum relevance score when packing?

  1. Weak matches can mislead the model, so leaving them out is often better
  2. It makes every chunk longer
  3. It increases the context window
  4. It is required by JSON
Show answer

Answer: Weak matches can mislead the model, so leaving them out is often better

Only include content that genuinely helps.

Lesson: Packing Retrieved Chunks Into a Budget

8. What is a cost of sending duplicate chunks?

  1. They reduce latency
  2. They improve citations automatically
  3. They waste budget and can over-weight one source
  4. They shrink the model
Show answer

Answer: They waste budget and can over-weight one source

De-duplicate before packing.

Lesson: Removing Near-Duplicates

9. What is an advantage of extractive compression?

  1. It needs a second large model
  2. It always produces the shortest text
  3. Original wording is preserved, so it stays exact and citable
  4. It removes the need for retrieval
Show answer

Answer: Original wording is preserved, so it stays exact and citable

Extractive keeps exact sentences; abstractive rewrites them.

Lesson: Compressing Content

10. What is dynamic few-shot selection?

  1. Choosing the examples most similar to each request from a larger pool
  2. Using no examples ever
  3. Fine-tuning on every request
  4. Sending the whole pool every time
Show answer

Answer: Choosing the examples most similar to each request from a larger pool

Relevant examples, shorter prompts.

Lesson: Selecting Few-Shot Examples per Request

Ordering and Structure

11. Where is a sensible default place for the user question in a long context?

  1. Repeated in every document
  2. Hidden in the middle of the documents
  3. Before the system rules
  4. At the end, after the documents
Show answer

Answer: At the end, after the documents

Question last keeps it close to where the model starts answering.

Lesson: Ordering Content in a Long Context

12. Why escape content placed inside tags?

  1. To make it shorter
  2. So content cannot close the tag and inject its own section
  3. To translate it
  4. To make the model faster
Show answer

Answer: So content cannot close the tag and inject its own section

Escaping keeps data inside its boundary, though it is not a complete defence.

Lesson: Delimiters and Templates

13. Why add a short reminder near the question in long contexts?

  1. It replaces the system prompt
  2. It helps the model apply key constraints after reading a lot of content
  3. It doubles the context window
  4. It removes the need for evaluation
Show answer

Answer: It helps the model apply key constraints after reading a lot of content

A brief restatement of the critical rules is cheap and often helps.

Lesson: Instruction Placement and Repetition

History, Memory and Tool Output

14. Why not send the full conversation forever?

  1. It makes answers shorter
  2. Models cannot read history
  3. History is illegal to store
  4. It eventually overflows the window and increases cost every turn
Show answer

Answer: It eventually overflows the window and increases cost every turn

Window plus summary keeps context bounded.

Lesson: Managing Conversation History

15. What should happen to long-term memories over time?

  1. They should be updatable and deletable, with privacy rules applied
  2. They should never change
  3. They should all be sent on every call
  4. They should include passwords for convenience
Show answer

Answer: They should be updatable and deletable, with privacy rules applied

Memory is user data with a lifecycle.

Lesson: Long-Term Memory: Store and Retrieve

16. Why keep the tail when truncating a long log?

  1. Models only read the tail
  2. The tail is always shorter
  3. Errors and final status often appear at the end
  4. The head is never useful
Show answer

Answer: Errors and final status often appear at the end

Head-and-tail keeps context and outcome.

Lesson: Keeping Tool Output Under Control

Caching, Output Contracts and Versioning

17. Where should a per-request timestamp go to keep caching effective?

  1. Inside every example
  2. At the very top of the prompt
  3. After the stable instructions and examples
  4. In the tool definitions
Show answer

Answer: After the stable instructions and examples

Caching reuses the exact identical prefix.

Lesson: Structuring Prompts for Caching

18. Why validate structured output even when using JSON mode?

  1. Responses can still miss fields, use wrong types or be truncated
  2. JSON mode guarantees business correctness
  3. Validation trains the model
  4. It is only needed for images
Show answer

Answer: Responses can still miss fields, use wrong types or be truncated

Treat model output like any untrusted input to your code.

Lesson: Structured Output as a Contract

19. Why log the template version with each request?

  1. To hide changes from users
  2. To increase the context window
  3. Because models require it
  4. So results can be reproduced and compared across prompt changes
Show answer

Answer: So results can be reproduced and compared across prompt changes

Traceability makes prompt changes safe.

Lesson: Versioning Prompts and Context Pipelines

Untrusted Content, Privacy and Grounding

20. Which is the most robust defence against injected instructions in retrieved content?

  1. A longer list of banned phrases
  2. Limiting the model's permissions and requiring confirmation for sensitive actions
  3. Telling the model to be careful once
  4. Using a larger context window
Show answer

Answer: Limiting the model's permissions and requiring confirmation for sensitive actions

Detection helps, but limiting capability bounds the damage.

Lesson: Prompt Injection Through Context

21. Where should document access rights be enforced?

  1. In an instruction asking the model not to reveal it
  2. At retrieval time, before content reaches the model
  3. After the answer is shown
  4. Nowhere, the model decides
Show answer

Answer: At retrieval time, before content reaches the model

Context should only contain what the user may see.

Lesson: Data Minimisation in Context

22. Why include unanswerable questions in tests?

  1. Because models cannot cite
  2. To make tests faster
  3. To lower the token count
  4. To check the system admits missing information instead of guessing
Show answer

Answer: To check the system admits missing information instead of guessing

Honest not-found answers are a quality signal.

Lesson: Grounding, Citations and Saying Not Found

Evaluating and Applying Context Strategies

23. What is an ablation?

  1. Changing or removing one component and measuring the effect
  2. Changing everything at once
  3. Deleting the evaluation set
  4. Retraining the model
Show answer

Answer: Changing or removing one component and measuring the effect

One variable at a time isolates the cause.

Lesson: Evaluating Context Changes With Ablations

24. In the case study, what fixed citations of outdated policies?

  1. Sending all 3,000 pages
  2. Raising the temperature
  3. Filtering retrieval to current policy versions
  4. Removing the question
Show answer

Answer: Filtering retrieval to current policy versions

Metadata filtering beats hoping the model notices dates.

Lesson: Case Study: A Support Assistant Over Policy Documents

25. When should you rerun context ablations?

  1. Only when the UI changes
  2. Never, results are permanent
  3. After switching or upgrading the model, and after major prompt changes
  4. Only once a year regardless of changes
Show answer

Answer: After switching or upgrading the model, and after major prompt changes

Context behaviour depends on the model.

Lesson: A Context Engineering Checklist

← Back to the course