0
0
Prompt Engineering / GenAIml~20 mins

Iterative prompt refinement in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Iterative Prompt Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why is iterative prompt refinement important in generative AI?

Consider you want to get the best answer from a generative AI model. Why do you need to refine your prompt step-by-step?

ABecause the model ignores the first prompt and only answers the last one.
BBecause the model learns from each prompt and updates itself automatically.
CBecause refining the prompt helps clarify the question and guides the model to produce better answers.
DBecause the model only understands very short prompts and needs multiple tries.
Attempts:
2 left
💡 Hint

Think about how clear instructions affect the quality of answers.

Predict Output
intermediate
1:30remaining
What is the output of this prompt refinement simulation?

Given the following Python code simulating prompt refinement scores, what is the final score printed?

Prompt Engineering / GenAI
scores = [0.5, 0.7, 0.85, 0.9]
final_score = scores[-1]
print(final_score)
A0.5
B0.7
C0.85
D0.9
Attempts:
2 left
💡 Hint

Look at the last item in the list.

Model Choice
advanced
2:30remaining
Which model is best suited for iterative prompt refinement tasks?

You want to refine prompts iteratively to generate detailed text answers. Which model type is most suitable?

AA small rule-based chatbot with fixed responses.
BA large language model trained on diverse text data with few-shot learning ability.
CA simple keyword matching model without context understanding.
DA model trained only on numerical data without language capabilities.
Attempts:
2 left
💡 Hint

Think about which model can understand and generate complex text.

Metrics
advanced
2:00remaining
Which metric best measures improvement during iterative prompt refinement?

When refining prompts to improve AI responses, which metric helps track progress effectively?

AUser satisfaction score or relevance rating of generated answers.
BModel training loss on unrelated data.
CNumber of words in the prompt.
DThe time taken to type the prompt.
Attempts:
2 left
💡 Hint

Consider what shows better quality in AI answers.

🔧 Debug
expert
2:30remaining
What error does this iterative prompt refinement code produce?

Examine the code below that tries to refine prompts and print the best one. What error occurs when running it?

Prompt Engineering / GenAI
prompts = ['Tell me a joke', 'Tell me a funny joke', 'Tell me a very funny joke']
best_prompt = None
best_score = 0
for prompt in prompts:
    score = len(prompt) / 0  # Simulate scoring
    if score > best_score:
        best_score = score
        best_prompt = prompt
print(best_prompt)
AZeroDivisionError
BIndexError
CNameError
DTypeError
Attempts:
2 left
💡 Hint

Look at the scoring line carefully.