Prompt Engineering Practice Test
Practise the prompt techniques used in real AI products: clear instructions, few-shot examples, structured output, reducing hallucinations, and prompt injection.
Your progress
Answer all questions, then submit to see your score and explanations.
Question 1
A model keeps giving vague answers. What usually helps most?
Question 2
What is few-shot prompting?
Question 3
What is zero-shot prompting?
Question 4
What is the main purpose of a system prompt?
Question 5
When does asking the model to reason step by step help most?
Question 6
Your code must parse the model's reply. What is the best approach?
Question 7
What is an AI 'hallucination'?
Question 8
Which prompt change best reduces hallucinations in a factual Q&A app?
Question 9
Why wrap pasted content in delimiters such as XML tags or triple quotes?
Question 10
What does a higher temperature setting usually do?
Question 11
What is prompt injection?
Question 12
A complex task gives poor results in one long prompt. What is a good fix?
Question 13
Why give the model a role such as 'You are an experienced tax accountant'?
Question 14
A prompt works on some inputs but not others. What is the best next step?
Question 15
Which instruction is usually more effective?
Please answer all questions before submitting.
Prompt Engineering Practice Test: all 15 questions with answers
Try each question first, then open “Show answer” to check the correct option and explanation.
Q1.A model keeps giving vague answers. What usually helps most?
- A.Writing the prompt in capital letters
- B.Giving specific instructions, relevant context and the output format you want
- C.Making the prompt as short as possible
- D.Asking the same question again without changes
Show answer
Correct answer: B. Giving specific instructions, relevant context and the output format you want
Models perform best when the task, context, audience and expected format are stated clearly.
Q2.What is few-shot prompting?
- A.Limiting the model to a few words
- B.Including a few worked examples of input and desired output in the prompt
- C.Running the prompt a few times
- D.Using a smaller model
Show answer
Correct answer: B. Including a few worked examples of input and desired output in the prompt
Examples show the model the exact pattern, tone and format to follow.
Q3.What is zero-shot prompting?
- A.Asking the model to do a task without giving any examples
- B.A prompt with zero words
- C.A prompt that always fails
- D.Training a model from scratch
Show answer
Correct answer: A. Asking the model to do a task without giving any examples
Zero-shot means the model relies only on the instructions, with no examples.
Q4.What is the main purpose of a system prompt?
- A.To store the user's password
- B.To set the model's role, rules and behaviour for the whole conversation
- C.To speed up the API
- D.To translate the user's message
Show answer
Correct answer: B. To set the model's role, rules and behaviour for the whole conversation
System prompts give persistent instructions, such as role, tone, constraints and output rules.
Q5.When does asking the model to reason step by step help most?
- A.Simple greetings
- B.Multi-step problems such as maths, logic or planning
- C.Spelling a single word
- D.Choosing a random number
Show answer
Correct answer: B. Multi-step problems such as maths, logic or planning
Step-by-step (chain-of-thought) reasoning gives the model room to work through intermediate steps before answering.
Q6.Your code must parse the model's reply. What is the best approach?
- A.Hope the model formats it correctly
- B.Ask for an exact format such as JSON with a defined schema, and validate the result
- C.Ask for a friendly paragraph
- D.Use a higher temperature
Show answer
Correct answer: B. Ask for an exact format such as JSON with a defined schema, and validate the result
A defined schema (or a structured-output feature) plus validation makes output reliable for code.
Q7.What is an AI 'hallucination'?
- A.The model refusing to answer
- B.The model stating false or unsupported information confidently
- C.A very slow response
- D.An image generated by AI
Show answer
Correct answer: B. The model stating false or unsupported information confidently
Hallucinations are fluent but incorrect or made-up statements.
Q8.Which prompt change best reduces hallucinations in a factual Q&A app?
- A.Ask the model to sound more confident
- B.Provide the source documents and tell the model to answer only from them and say when it does not know
- C.Raise the temperature
- D.Remove all context
Show answer
Correct answer: B. Provide the source documents and tell the model to answer only from them and say when it does not know
Grounding the model in sources and allowing 'I don't know' cuts down on invented answers.
Q9.Why wrap pasted content in delimiters such as XML tags or triple quotes?
- A.It makes the prompt look nicer
- B.It clearly separates instructions from the data the model should work on
- C.It reduces the token count to zero
- D.It is required by every API
Show answer
Correct answer: B. It clearly separates instructions from the data the model should work on
Delimiters stop the model from confusing your instructions with the document or user input.
Q10.What does a higher temperature setting usually do?
- A.Makes outputs more random and varied
- B.Makes outputs always identical
- C.Makes the model faster
- D.Increases the context window
Show answer
Correct answer: A. Makes outputs more random and varied
Higher temperature samples less likely tokens more often, giving more varied output. Lower is more deterministic.
Q11.What is prompt injection?
- A.A way to make prompts shorter
- B.Untrusted input that contains instructions trying to override the application's own instructions
- C.Adding examples to a prompt
- D.A method for fine-tuning
Show answer
Correct answer: B. Untrusted input that contains instructions trying to override the application's own instructions
For example, a web page or email that says 'ignore previous instructions'. Treat such content as data, never as commands.
Q12.A complex task gives poor results in one long prompt. What is a good fix?
- A.Break it into smaller steps and chain prompts, passing each result to the next
- B.Add more exclamation marks
- C.Remove all instructions
- D.Use the same prompt with a random seed
Show answer
Correct answer: A. Break it into smaller steps and chain prompts, passing each result to the next
Prompt chaining lets each step focus on one job and makes failures easier to debug.
Q13.Why give the model a role such as 'You are an experienced tax accountant'?
- A.It changes the model's training data
- B.It focuses tone, vocabulary and level of expertise for the task
- C.It makes answers guaranteed to be correct
- D.It is required for the API to work
Show answer
Correct answer: B. It focuses tone, vocabulary and level of expertise for the task
A role frames how the model should approach the task. It does not add new knowledge or guarantee accuracy.
Q14.A prompt works on some inputs but not others. What is the best next step?
- A.Try it once more and ship it
- B.Build a small test set of example inputs and compare outputs as you change the prompt
- C.Delete the prompt
- D.Only test with your favourite example
Show answer
Correct answer: B. Build a small test set of example inputs and compare outputs as you change the prompt
Evaluating against a fixed set of examples turns prompt tuning into measurable work instead of guesswork.
Q15.Which instruction is usually more effective?
- A."Don't use markdown."
- B."Write your answer as plain prose paragraphs."
- C."No bad formatting!!!"
- D."Format it however."
Show answer
Correct answer: B. "Write your answer as plain prose paragraphs."
Telling the model what to do works better than only telling it what not to do.