0
0
Prompt Engineering / GenAIml~20 mins

Prompt templates and variables in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Prompt Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Prompt Variables
In prompt templates, variables are placeholders replaced by actual values during generation. Which statement best describes the role of variables in prompt templates?
AVariables are used to store the output generated by the AI model.
BVariables define fixed text that never changes in the prompt.
CVariables are only used to control the length of the generated text.
DVariables are placeholders that get replaced with dynamic content when generating text.
Attempts:
2 left
💡 Hint
Think about how you can customize a prompt for different inputs.
Predict Output
intermediate
1:30remaining
Output of a Prompt Template with Variables
Given the prompt template: "Write a story about a {animal} who loves {activity}." and the variables animal='cat' and activity='painting', what is the final prompt after variable substitution?
AWrite a story about a {animal} who loves painting.
BWrite a story about a dog who loves painting.
CWrite a story about a cat who loves painting.
DWrite a story about a cat who loves {activity}.
Attempts:
2 left
💡 Hint
Replace all variables with their given values.
Model Choice
advanced
2:00remaining
Choosing a Model for Prompt Templates with Variables
You want to generate creative stories using prompt templates with variables. Which type of AI model is best suited for this task?
AA regression model that predicts numerical values.
BA generative language model that produces text based on input prompts.
CA classification model that labels text into categories.
DA clustering model that groups similar data points.
Attempts:
2 left
💡 Hint
Think about which model creates new text from prompts.
Hyperparameter
advanced
2:00remaining
Effect of Temperature in Prompt-Based Generation
When using prompt templates with variables in a generative AI model, adjusting the 'temperature' hyperparameter affects the output. What happens when you increase the temperature value?
AThe output becomes more random and creative.
BThe output becomes more repetitive and predictable.
CThe model stops generating any output.
DThe output length is fixed to a shorter size.
Attempts:
2 left
💡 Hint
Higher temperature means more randomness.
Metrics
expert
2:30remaining
Evaluating Prompt Template Effectiveness
You have multiple prompt templates with variables generating text outputs. Which metric best helps you measure how well the generated text matches the intended meaning or context?
ABLEU score measuring overlap with reference texts.
BMean Squared Error measuring numerical differences.
CSilhouette score measuring cluster separation.
DAccuracy measuring correct class predictions.
Attempts:
2 left
💡 Hint
Look for a metric that compares generated text to reference text.