Generative AI Mastery Quizzes
Prompt Engineering
This practice test evaluates your ability to engineer robust, accurate, and secure prompts.
You will be tested on the anatomy of a prompt, advanced strategies like Chain-of-Thought, understanding API parameters (like Temperature), and mitigating security risks like Prompt Injection.
Prompt Strategies: Test your knowledge of Few-Shot, Zero-Shot, and Meta-prompting.
API Levers: Prove you know when to use High vs. Low Temperature and Top-P.
Security: Can you properly sandbox a prompt to defend against Jailbreaks?
Ready to master the machine? Begin the quiz!
Question 1
What are the four core pillars that make up the anatomy of a highly effective, professional prompt?
Question 2
Why does assigning a 'Persona' (e.g., 'Act as a Senior Python Developer') drastically improve an LLM's response?
Question 3
When building an AI application via an API, what is the primary difference between a System Prompt and a User Prompt?
Question 4
Which prompting strategy involves providing the AI with several examples of the desired input and output pattern before giving it the actual task?
Question 5
By simply adding the phrase 'Think step-by-step' to a prompt, you can drastically improve an LLM's mathematical and logical accuracy. What is this technique called?
Question 6
If you are struggling to write a highly complex prompt, what is the 'Meta-Prompting' strategy?
Question 7
Based on the image below, how should you adjust the API 'Temperature' if you are building an AI tool that extracts precise factual data from legal contracts?
Question 8
If you set the 'Top-P' parameter to 0.9, how does it affect the LLM's output?
Question 9
Which API parameters can be used to prevent an LLM from endlessly repeating the same phrase over and over again?
Question 10
What is the specific purpose of a 'Stop Sequence' in prompt engineering?
Question 11
Why is 'Prompt Injection' considered the most dangerous security vulnerability in Generative AI applications?
Question 12
What is 'Jailbreaking' in the context of LLMs?
Question 13
Based on the image below, what is the best defensive strategy to protect a prompt against injection attacks when processing user-submitted text?
Question 14
LLMs suffer from 'Recency Bias', meaning they pay the most attention to the very last thing they read. How can developers use this to defend against prompt injection?
Question 15
Select the correct example of a 'Grounding Constraint' used to mitigate AI hallucinations:
End of Quiz
Your final score is: 0 / 0
List of Questions
Question 1: What are the four core pillars that make up the anatomy of a highly effective, professional prompt?
Answers: Persona (Role), Context (Background), Task (What to do), Format (How to output).
Question 2: Why does assigning a 'Persona' (e.g., 'Act as a Senior Python Developer') drastically improve an LLM's response?
Answers: It alters the probability distribution of the model, forcing it to draw from highly technical, professional embeddings rather than generic, average text..
Question 3: When building an AI application via an API, what is the primary difference between a System Prompt and a User Prompt?
Answers: The System Prompt contains the developer's overarching, unbreakable rules for the AI's behavior, while the User Prompt is the actual query typed by the human..
Question 4: Which prompting strategy involves providing the AI with several examples of the desired input and output pattern before giving it the actual task?
Answers: Few-Shot Prompting.
Question 5: By simply adding the phrase 'Think step-by-step' to a prompt, you can drastically improve an LLM's mathematical and logical accuracy. What is this technique called?
Answers: Chain-of-Thought (CoT).
Question 6: If you are struggling to write a highly complex prompt, what is the 'Meta-Prompting' strategy?
Answers: Using the LLM to write its own prompt by asking it: 'What context, rules, and examples do you need from me to generate the perfect prompt for task X?'.
Question 7: Based on the image below, how should you adjust the API 'Temperature' if you are building an AI tool that extracts precise factual data from legal contracts?
Answers: Set Temperature to 0.1 (Low) to make the model highly deterministic, factual, and focused..
Question 8: If you set the 'Top-P' parameter to 0.9, how does it affect the LLM's output?
Answers: It dynamically filters the vocabulary, forcing the model to only select from the pool of words that make up the top 90% of probable next words, completely ignoring wild outlier words..
Question 9: Which API parameters can be used to prevent an LLM from endlessly repeating the same phrase over and over again?
Answers: Frequency Penalty, Presence Penalty.
Question 10: What is the specific purpose of a 'Stop Sequence' in prompt engineering?
Answers: It is a developer-defined string (e.g., `"User:"`); if the LLM attempts to generate this string, generation halts instantly..
Question 11: Why is 'Prompt Injection' considered the most dangerous security vulnerability in Generative AI applications?
Answers: Because LLMs read both developer instructions and user data in the exact same natural language format, allowing malicious users to input data that tricks the AI into treating it as a new, overriding instruction..
Question 12: What is 'Jailbreaking' in the context of LLMs?
Answers: A type of prompt injection that uses elaborate roleplay scenarios (e.g., 'Act as DAN - Do Anything Now') to trick the model into bypassing its corporate safety and ethical filters..
Question 13: Based on the image below, what is the best defensive strategy to protect a prompt against injection attacks when processing user-submitted text?
Answers: Use Delimiters (like XML tags) to 'sandbox' the text, and explicitly instruct the AI that anything inside those tags is raw data and must NEVER be treated as instructions..
Question 14: LLMs suffer from 'Recency Bias', meaning they pay the most attention to the very last thing they read. How can developers use this to defend against prompt injection?
Answers: By placing the most critical safety and formatting instructions at the very END of the prompt (the Suffix), immediately following the user's input..
Question 15: Select the correct example of a 'Grounding Constraint' used to mitigate AI hallucinations:
Answers: "Answer the question using ONLY the provided text.", "If the answer is not contained in the text, you must output 'Data Unavailable'.".