Back to courses
AI Skills for Everyone beginner

Prompt Engineering: Getting the Best From Ai

Duration0 hours
Modules7
ForGeneral public, lifelong learners
Video1-2min
Get started — free →

Course outline

Module 1 Module 1: Foundations of Prompt Design

Foundations of Prompt Design

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. Which of the following best describes a prompt in the context of working with an AI language model?
  • A. A password that unlocks the model's full capabilities
  • B. The input text that instructs the model on what task to perform and how to respond ✓
  • C. A training dataset used to fine-tune the model's weights
  • D. An error message generated when the model cannot process a request

Why: A prompt is the input text you give the model, including instructions, context, and any examples, that guides the output it produces. It is not a password, a training dataset, or an error message.

Q2. Which prompt is likely to produce the most useful response?
  • A. Write about dogs.
  • B. Tell me something about pets.
  • C. Write a 150-word blog introduction about adopting an adult dog, aimed at first-time pet owners and written in a warm, encouraging tone. ✓
  • D. Dogs?

Why: Specific prompts that define the task, length, audience, and tone give the model clear constraints, leading to more relevant and useful output. Vague prompts leave too much open to interpretation.

Q3. What does it mean to provide 'context' in a prompt?
  • A. Repeating your question several times to emphasize it
  • B. Including background information the model needs to understand the task, such as the purpose, audience, or relevant details ✓
  • C. Asking the model to recall its previous training data word for word
  • D. Setting the maximum length of the model's response

Why: Context is the background information that helps the model understand your situation, such as who the output is for, why it is needed, and what relevant facts apply. Repetition, recall of training data, and length settings are different things.

Q4. Why is it useful to specify an output format in a prompt, such as 'respond as a bulleted list' or 'return valid JSON'?
  • A. It makes the model run faster on the same hardware
  • B. It guarantees the content is factually correct
  • C. It makes the response easier to read, parse, or integrate into other tools and workflows ✓
  • D. It prevents the model from making any errors

Why: Specifying a format shapes the response into a predictable structure, which is valuable for human readability and for programmatic use. It does not affect speed, guarantee accuracy, or eliminate errors.

Q5. Which technique involves giving the model one or more examples of the desired input-output pattern before asking it to complete a new task?
  • A. Zero-shot prompting
  • B. Few-shot prompting ✓
  • C. Temperature scaling
  • D. Token truncation

Why: Few-shot prompting includes a small number of examples in the prompt to demonstrate the expected pattern. Zero-shot prompting gives no examples, while temperature scaling and token truncation are unrelated to example-based instruction.

Module 2 Module 2: Writing Clear Instructions

Writing Clear Instructions

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. Which instruction is clearest for an AI model that needs to summarize a report?
  • A. Summarize this report.
  • B. Summarize this report in 3 bullet points for a non-technical manager, focusing on costs and deadlines. ✓
  • C. Make this shorter and nicer.
  • D. Do something useful with this report.

Why: Clear instructions specify the task, the output format, the audience, and the focus. Option B gives all of these, so the model knows exactly what a good response looks like.

Q2. Why is it helpful to specify the desired output format in a prompt?
  • A. It makes the AI respond more slowly.
  • B. It reduces ambiguity so the response is easier to use directly. ✓
  • C. It guarantees the information is factually correct.
  • D. It forces the AI to use more words.

Why: Stating the format (a table, a list, JSON, a word limit) removes guesswork about structure, so the output can be used without extensive reformatting. It does not guarantee accuracy or length.

Q3. Which prompt best avoids vague wording?
  • A. Write something about dogs.
  • B. Write a few nice sentences about dogs.
  • C. Write a 100-word product description for a waterproof dog leash aimed at hikers. ✓
  • D. Tell me stuff about dogs that's interesting.

Why: Option C defines the length, content, and audience precisely. Words like 'something,' 'nice,' 'a few,' and 'interesting' leave the model to guess what you mean.

Q4. What is a good practice when your first AI response doesn't match what you wanted?
  • A. Give up and assume the AI cannot help.
  • B. Repeat the exact same prompt several times without changes.
  • C. Refine the prompt by adding specific constraints or examples of what you want. ✓
  • D. Switch to typing in all capital letters.

Why: Iterating on the prompt by adding missing details, constraints, or examples usually improves results. Repeating an identical prompt rarely changes much, since the model has no new information to work with.

Q5. Which instruction best tells the AI what to do rather than what to avoid?
  • A. Don't make the answer too long or use jargon.
  • B. Don't be confusing.
  • C. Don't include any unnecessary details.
  • D. Keep the answer under 150 words and explain each term in plain English. ✓

Why: Positive instructions state the desired behavior directly, which is usually easier for a model to follow. Option D tells the model exactly what to do, while the other options only describe what to avoid without specifying the alternative.

Module 3 Module 3: Providing Context and Examples

Providing Context and Examples

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. Why does adding context to a prompt usually improve the quality of an AI's response?
  • A. It makes the prompt longer, which forces the AI to think for more time
  • B. It gives the AI background about the purpose, audience, and constraints, so it can tailor its answer appropriately ✓
  • C. It causes the AI to memorize the information permanently for future conversations
  • D. It reduces the number of tokens the AI needs to generate a response

Why: AI models produce responses based on the information in the prompt. Context such as the audience, purpose, and constraints narrows the range of reasonable answers, helping the model produce output that fits the user's actual need rather than a generic response.

Q2. Which of the following is the best example of a few-shot prompt?
  • A. Write a poem about the ocean.
  • B. Write a poem about the ocean in a formal tone, at least 12 lines long, and for a high school audience.
  • C. Classify these reviews as positive or negative. Example: 'Great service!' -> Positive. 'Food was cold.' -> Negative. Now classify: 'The room was spotless.' ✓
  • D. Please, I really need you to be as helpful as possible and answer carefully.

Why: Few-shot prompting includes a small number of worked examples of the input-output pattern you want before presenting the new case. Option C shows two labeled examples followed by a new input, which lets the model infer the task format and labeling rules.

Q3. What is a key benefit of providing an example output format within your prompt?
  • A. It guarantees the AI will never make factual errors
  • B. It removes the need to explain the task at all
  • C. It makes the response structure more consistent and easier to parse or use ✓
  • D. It forces the AI to respond in fewer than 50 words

Why: Showing the desired format, such as a specific table layout, JSON structure, or bullet pattern, helps the model reproduce that structure reliably. This is especially useful when the output will be read by another program or compared across many responses. It does not guarantee accuracy or length.

Q4. A user wants AI help writing emails to customers who had a delayed shipment. Which addition would most improve the prompt?
  • A. Make it sound better
  • B. Write an email
  • C. Write an apology email to a customer whose order shipped 5 days late, acknowledging the delay, offering a 10% discount code, and keeping a warm but professional tone ✓
  • D. Write something nice

Why: The strongest prompt supplies specifics: the situation, the required content elements, and the tone. These details let the model produce a usable draft on the first attempt instead of guessing at what the user needs.

Q5. When is it most appropriate to provide examples in a prompt rather than relying on instructions alone?
  • A. Only when the user does not know how to describe the task in words
  • B. When the desired style, format, or pattern is hard to describe precisely in words ✓
  • C. Examples should never be used because they confuse the model
  • D. Only for tasks involving mathematics

Why: Some qualities, such as a particular writing voice, a nuanced classification scheme, or an unusual formatting pattern, are easier to show than to explain. Examples communicate these patterns directly, often more effectively than lengthy verbal descriptions.

Module 4 Module 4: Structuring Output Formats

Structuring Output Formats

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. Which element of a prompt most directly tells the AI what format its response should take?
  • A. The role or persona assigned to the AI
  • B. An explicit output format instruction, such as requesting JSON or a bulleted list ✓
  • C. The temperature setting used by the model
  • D. The length of the user's question

Why: Explicit format instructions, such as naming JSON or a specific structure, are the most direct way to control output format. Personas influence tone and perspective, temperature affects randomness, and question length does not dictate structure.

Q2. Why is it helpful to provide an example of the desired output within a prompt?
  • A. It makes the prompt longer, which always improves quality
  • B. It shows the model the exact structure, keys, and style to follow ✓
  • C. It forces the model to memorize the example for future conversations
  • D. It disables the model's ability to make mistakes

Why: A concrete example demonstrates the expected structure, field names, and style, reducing ambiguity. Models learn the pattern from the example far more reliably than from a verbal description alone.

Q3. If you need an AI response that a program can parse automatically, which instruction is most appropriate?
  • A. Please write something nice about the topic
  • B. Return only valid JSON with no surrounding text or markdown ✓
  • C. Give me your best thoughts when you have time
  • D. Try to be creative with how you present the answer

Why: Asking for only valid JSON with no surrounding text or markdown produces output a parser can read directly. Vague or open-ended instructions often add prose or code fences that break automated processing.

Q4. What is a common reason an AI response might include extra text like 'Here is your JSON:' before the data?
  • A. The model is malfunctioning and must be reset
  • B. The prompt did not explicitly prohibit conversational preamble ✓
  • C. JSON format requires an introduction to be valid
  • D. The model always adds introductions regardless of instructions

Why: Models default to conversational framing unless told otherwise. Stating that the output should contain only the JSON, with no introduction or explanation, prevents this extra text.

Q5. Which practice best helps ensure a structured response stays consistent across many runs?
  • A. Using a different format name each time to keep answers varied
  • B. Specifying the exact field names, data types, and nesting you expect ✓
  • C. Asking for the answer in as many formats as possible
  • D. Leaving the structure open so the model can improve it

Why: Specifying exact field names, data types, and nesting constrains the output to a predictable schema. This consistency is essential when the output feeds into other systems or is compared across runs.

Module 5 Module 5: Chain-of-Thought and Reasoning Prompts

Chain-of-Thought and Reasoning Prompts

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the main purpose of chain-of-thought prompting?
  • A. To make the AI respond faster by shortening its answers
  • B. To encourage the AI to show intermediate reasoning steps before giving a final answer ✓
  • C. To translate prompts into multiple languages
  • D. To limit the AI's responses to a single word

Why: Chain-of-thought prompting asks the model to work through a problem step by step, which often improves accuracy on tasks requiring multi-step reasoning.

Q2. Which of the following is a simple way to trigger chain-of-thought reasoning in a prompt?
  • A. Adding the phrase 'Let's think step by step' to the prompt ✓
  • B. Writing the prompt in all capital letters
  • C. Asking the model to respond with only yes or no
  • D. Removing all context from the question

Why: The phrase 'Let's think step by step' is a widely used zero-shot trigger that prompts the model to reason through intermediate steps before answering.

Q3. Why might a model make mistakes on a math word problem when asked for the answer directly?
  • A. Models cannot read numbers in text
  • B. Jumping straight to an answer skips the intermediate reasoning that helps catch errors ✓
  • C. Models only work with numbers written as digits
  • D. Word problems are always longer than the model's context window

Why: When a model commits to an answer immediately, it has no space to break the problem down, so errors in intermediate calculations go uncorrected.

Q4. What is a 'few-shot' chain-of-thought prompt?
  • A. A prompt that asks for only a few words in response
  • B. A prompt that includes a few worked examples showing step-by-step reasoning before the new question ✓
  • C. A prompt that is sent to the model only a few times
  • D. A prompt that uses a small number of tokens

Why: Few-shot chain-of-thought prompts demonstrate the desired reasoning pattern through example question-and-solution pairs, guiding the model to reason similarly on the new question.

Q5. Which practice most helps you verify the reasoning a model provides?
  • A. Accepting the answer as correct if the reasoning sounds confident
  • B. Checking each intermediate step for logical and factual errors ✓
  • C. Asking the model to repeat its final answer three times
  • D. Shortening the prompt to reduce the chance of errors

Why: Reasoning can sound convincing while containing errors, so checking each step is essential to confirm that the final answer is trustworthy.

Module 6 Module 6: Iterating and Evaluating Responses

Iterating and Evaluating Responses

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the most effective first step when an AI response does not meet your needs?
  • A. Abandon the conversation and start over with a new chat
  • B. Identify specifically what is wrong with the response and refine your prompt accordingly
  • C. Accept the response as-is because the AI's first answer is usually the best
  • D. Ask the AI to make the response longer without changing anything else
Q2. Which follow-up instruction is most likely to improve a vague AI response?
  • A. Good, now do something else
  • B. Make it better
  • C. Rewrite this as a three-bullet summary aimed at a non-technical manager, focusing on cost impacts
  • D. Try again
Q3. Why is it useful to evaluate AI responses against specific criteria before iterating?
  • A. Criteria make the AI respond faster to your prompts
  • B. Clear criteria, such as accuracy, tone, length, and relevance, help you pinpoint exactly what to change in your next prompt
  • C. Criteria remove the need to read the response carefully
  • D. The AI only responds to prompts that include a scoring rubric
Q4. When a response contains a factual claim you are unsure about, what is the best iteration strategy?
  • A. Assume it is correct since the AI sounds confident
  • B. Ask the AI to cite its sources or explain its reasoning, then verify the claim independently
  • C. Delete the claim and never revisit the topic
  • D. Ask the AI to repeat the same claim in a different format
Q5. Which practice best helps you track improvement across multiple prompt iterations?
  • A. Keeping only the final version of the prompt and discarding earlier attempts
  • B. Changing one element of the prompt at a time and noting how each change affected the output
  • C. Changing the entire prompt, topic, and tone with every attempt
  • D. Relying on memory to recall which wording worked earlier
Module 7 Module 7: Advanced Techniques and Best Practices

Advanced Techniques and Best Practices

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. Which technique involves providing a few examples of the desired input-output pattern within a prompt before asking the model to complete a new task?
  • A. Zero-shot prompting
  • B. Few-shot prompting ✓
  • C. Chain-of-thought prompting
  • D. Role prompting

Why: Few-shot prompting includes several worked examples in the prompt so the model can infer the desired pattern, format, and style before handling the new input.

Q2. What is the main benefit of asking an AI model to 'think step by step' before giving a final answer?
  • A. It makes the response shorter and more concise
  • B. It guarantees the answer is factually correct
  • C. It helps the model break down multi-step problems, often improving accuracy on reasoning tasks ✓
  • D. It prevents the model from using any external information

Why: Chain-of-thought prompting encourages the model to lay out intermediate reasoning steps, which often improves performance on math, logic, and multi-step problems, though it does not guarantee correctness.

Q3. Which of the following is an example of role prompting?
  • A. Asking the model to list five facts about photosynthesis
  • B. Telling the model to act as an experienced nutritionist when answering diet questions ✓
  • C. Providing a list of example questions and answers
  • D. Specifying that the response must be under 100 words

Why: Role prompting assigns the model a persona or expertise, such as a nutritionist, to shape the tone, knowledge focus, and perspective of its responses.

Q4. Why is it a best practice to specify the desired output format in a prompt (for example, a table, bulleted list, or JSON)?
  • A. It makes the model slower but more thorough
  • B. It removes the need to check the model's output
  • C. It makes responses easier to use and parse, reducing the need for reformatting ✓
  • D. It forces the model to use more tokens for no benefit

Why: Explicit format instructions produce consistent, usable output that can be integrated into workflows or processed by other software, saving time on manual reformatting.

Q5. What is the best approach when an AI response is not what you wanted on the first attempt?
  • A. Give up and assume the model cannot perform the task
  • B. Repeat the exact same prompt until a different result appears
  • C. Refine the prompt by adding clearer context, constraints, or examples, then try again ✓
  • D. Switch to writing the entire response yourself without further attempts

Why: Iterative refinement, adjusting the prompt with more context, constraints, or examples, is a core prompt engineering practice that typically yields better results than repeating the same prompt unchanged.

Stay in the loop on this course.

We’ll email you when new modules or related material drops. No spam.

Built with Fragment Language. Sovereign architecture — no third-party trackers.
FragRun.mfgAFImemoryFGOwnership: B-Systems.ee