AI & machine learning quiz

Prompt Engineering Quiz: Write Better Prompts for ChatGPT, Claude and Gemini

Learn to get reliable results from any AI chatbot. 60 scenario questions on prompt anatomy, zero-shot and few-shot prompting, step-by-step reasoning, structured output, iteration, RAG and grounding, prompt injection and responsible use.

✅ Free · no login60 questions⏱ Timer📝 Explanations🖨 Mark sheet & PDFBeginner to intermediate
Prompt Engineering Quiz: free online quiz with timer and mark sheet by Codanics
Loading…

Prompt Engineering Quiz

60 questions · 8 topics · timer · instant explanations · printable mark sheet.

  • Questions60 in the bank, 10–30 per attempt
  • Levels20 easy · 24 medium · 16 hard
  • TimeAbout 5–20 minutes
  • PriceFree, no login needed
  • Made byDr. Aammar Tufail, Codanics
  • Updated18 November 2026

In short: the Prompt Engineering Quiz is a free online multiple-choice quiz by Codanics with 60 questions on prompt anatomy and roles; zero-shot and few-shot; step-by-step reasoning; structured output; prompts for code and data; iteration and evaluation; grounding and RAG; and safety and responsible use. You choose the number of questions and the difficulty, answer against a timer, see an explanation after every answer and finish with a printable mark sheet.

🚀 Follow Codanics for more free quizzes and lessonsNew quizzes, free lessons, scholarships and PhD positions, straight to your phone.

What the Prompt Engineering Quiz covers

The same AI model can give a vague answer or an excellent one depending on the prompt. Prompt engineering is the skill of giving clear roles, context, constraints, examples and output formats, and checking the result.

This quiz is built from real situations: summarising papers, cleaning data with code, extracting JSON, avoiding hallucinated references and staying safe from prompt injection.

  • Prompt anatomy and roles 8 questions
  • Zero-shot and few-shot 7 questions
  • Step-by-step reasoning 7 questions
  • Structured output 8 questions
  • Prompts for code and data 7 questions
  • Iteration and evaluation 7 questions
  • Grounding and RAG 8 questions
  • Safety and responsible use 8 questions

Who it is for: Students, researchers, data scientists and developers who use AI chatbots for study, research, writing or coding.

How the quiz works

  1. Type your name if you want it printed on the mark sheet (optional; it never leaves your browser).
  2. Choose 10, 20 or 30 questions, a difficulty (Easy, Mixed or Hard) and the timer: Standard, Relaxed or none.
  3. Answer each question before the timer runs out. Press A–D or 1–4 on a keyboard, or tap an option on your phone.
  4. Read the explanation after every answer, then press Next.
  5. At the end, get your score, grade, topic-wise breakdown and a full answer review. Print it or save it as a PDF.
  6. Retake the quiz for a fresh random set, or practise only the topics you found hard.

Free video lessons from Codanics

Score lower than you hoped? These free lessons from the Codanics YouTube channel cover the same topics, explained step by step.

▶ Full playlist: Powerful AI tools and websites
Free on the Codanics YouTube channel, taught in Urdu/Hindi.

Sample questions with answers

Here are 10 questions from the bank, with answers and explanations. The quiz above draws from all 60.

1. A student needs a summary of a pasted paper for a 5-minute class talk. Which prompt is best?
  1. Summarise the paper below in 5 bullets for second-year students, max 120 words.
  2. Summarise the paper below and make the summary really good and very clear for me.
  3. Write about this paper as much as possible so I can present everything it says.
  4. You are a genius. Summarise this paper perfectly with no mistakes at all, please.

Answer: A. Summarise the paper below in 5 bullets for second-year students, max 120 words.
The best prompt states the task, the audience, the format (5 bullets) and a length limit. Praise, 'make it good' or 'as much as possible' give the model nothing concrete to aim for.

2. In the prompt below, which part is a constraint rather than the task itself? (Write an email to my supervisor asking for a one-week extension on my …)
Write an email to my supervisor asking for a one-week extension on my thesis chapter.
Keep it under 150 words, in a formal tone.
  1. Write an email
  2. To my supervisor
  3. Under 150 words, in a formal tone
  4. Asking for a one-week extension

Answer: C. Under 150 words, in a formal tone
The task is writing an email asking for an extension; the recipient is context. Word limit and tone are constraints that restrict how the task is done.

3. What is zero-shot prompting?
  1. Giving instructions for a task but no worked examples
  2. Giving the model a task with no instructions or context at all
  3. Training a new model from scratch without any data
  4. Asking only questions that can be answered with yes or no

Answer: A. Giving instructions for a task but no worked examples
Zero-shot means the prompt describes the task but contains no input-output examples. The model relies on what it learned in training to follow the instruction.

4. What is the main weakness of this few-shot classification prompt? (Review: Great course! -> Positive)
Review: Great course! -> Positive
Review: Loved the projects -> Positive
Review: Very helpful teacher -> Positive
Review: The videos kept freezing -> ?
  1. It uses three examples, but few-shot prompts need at least ten
  2. The examples are too short for the model to understand them
  3. The new review should be placed before the examples
  4. Every example has the same label, biasing the model

Answer: D. Every example has the same label, biasing the model
If every example is 'Positive', the model may lean toward that label. Good few-shot sets are balanced and cover each label and some tricky cases.

5. What is chain-of-thought prompting?
  1. Connecting several different chatbots together in a long chain
  2. Asking the model to answer every question in a single word
  3. Sending the same prompt repeatedly in a loop until it changes
  4. Asking for intermediate reasoning steps before the answer

Answer: D. Asking for intermediate reasoning steps before the answer
Chain-of-thought prompts (e.g. 'think step by step') ask for intermediate reasoning. This often improves accuracy on multi-step problems such as maths or logic.

6. Your Python script will read the model's answer automatically. Which output format should you ask for?
  1. Valid JSON with key names that you specify
  2. A friendly paragraph with the values inside it
  3. A bullet list decorated with emojis
  4. Whatever format the model thinks is best

Answer: A. Valid JSON with key names that you specify
Machine-readable output needs a fixed, parseable structure. JSON with named keys can be loaded with json.loads(); free text needs fragile parsing.

7. Which prompt gives an AI assistant the best chance of fixing a Python error?
  1. Write 'my code is not working, please fix it' and nothing else
  2. Paste only the last line of the error message
  3. Share the code, full traceback and expected result
  4. Describe the error from memory without showing any code

Answer: C. Share the code, full traceback and expected result
Debugging needs the exact code, the full traceback and the expected behaviour. Missing any one of these forces the model to guess.

8. The first output is not what you wanted. What is the best next step?
  1. Give up, because the model clearly cannot do this task
  2. Send the identical prompt again and hope for a different result
  3. Rewrite the same prompt entirely in capital letters
  4. Identify what was wrong and refine the prompt with specific feedback

Answer: D. Identify what was wrong and refine the prompt with specific feedback
Specific feedback such as 'too technical, use one analogy, max 100 words' turns a weak first answer into a useful one. Repeating the same prompt rarely fixes the cause.

9. In language models, what is a hallucination?
  1. When the model refuses to answer a question
  2. Fluent output that is false or unsupported
  3. An image created by an AI image generator
  4. When the model takes a long time to respond

Answer: B. Fluent output that is false or unsupported
Hallucinations are confident-sounding statements, numbers or citations that are wrong or invented. Grounding the model in sources and checking claims reduces the harm.

10. What is prompt injection?
  1. Adding extra few-shot examples to improve a prompt's accuracy
  2. Injecting a new dataset into the model to retrain it
  3. Hidden text in the input that tries to override instructions
  4. Pasting code into a prompt so the model can debug it

Answer: C. Hidden text in the input that tries to override instructions
In prompt injection, text supplied by a user or found in a document (e.g. 'ignore previous instructions…') tries to hijack the model's behaviour.

Free guides and blogs to study

Free tools for your studies and research

Codanics also has 160+ free online tools for students and researchers: statistics calculators, meta-analysis, PDF and writing tools. They run in your browser, with no login.

Browse all free tools →

Frequently asked questions

Is the Prompt Engineering Quiz free?

Yes. The Prompt Engineering Quiz is completely free, with no sign-up, no login and no limit on attempts.

How many questions are in the Prompt Engineering Quiz?

The question bank has 60 multiple-choice questions (20 easy, 24 medium and 16 hard) across 8 topics. Each attempt draws 10, 20 or 30 of them at random, so every attempt is different.

How does the timer work?

Each question has its own countdown: about 25 seconds for easy, 40 for medium and 55 for hard questions, plus 15 seconds when there is code to read. Choose Relaxed to double the time or switch the timer off to study at your own pace. Unanswered questions count as skipped.

Can I get a certificate or mark sheet?

Yes. When you finish, you get a mark sheet with your name, score, grade, time, topic-wise performance and every answer explained. Use Print or save as PDF to keep it. It is a self-assessment result, not an official certificate.

Are the answers and explanations correct?

Every question was written and reviewed for one clearly correct answer, and code questions were checked by running the code. If you think an answer is wrong, tell us on the Codanics WhatsApp channel or in the YouTube comments and we will fix it.

Does the prompt engineering quiz work for ChatGPT, Claude and Gemini?

Yes. The principles are model-independent: clear instructions, context, examples, output format and verification work with every modern chatbot.

Is prompt engineering still worth learning?

Yes. Better models reduce the need for tricks, but clear task descriptions, good context and checking outputs remain the difference between useful and misleading answers.

Is my data stored anywhere?

No. The quiz runs entirely in your browser. Your name, answers and score are not uploaded. Your best score and settings are remembered only in this browser so you can track your progress.

More free quizzes

See all Codanics quizzes → · Courses · Free tools · Blog

Follow Codanics

Created by Dr. Muhammad Aammar Tufail, Codanics. Published 18 November 2026, last updated 18 November 2026. Found a mistake or want a quiz on another topic? Tell us on the WhatsApp channel or contact us.