0
0
Prompt Engineering / GenAIml~20 mins

Conversation management in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Conversation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Context Windows in Conversation Management

In AI conversation systems, what is the main purpose of a context window?

ATo store and use recent conversation history to maintain context
BTo limit the number of users interacting with the AI simultaneously
CTo encrypt user data for privacy during conversations
DTo speed up the AI's response time by skipping processing
Attempts:
2 left
💡 Hint

Think about how the AI remembers what was said before.

Predict Output
intermediate
1:30remaining
Output of Conversation Turn Tracking Code

What is the output of this Python code that tracks conversation turns?

Prompt Engineering / GenAI
turns = ['Hi', 'Hello', 'How are you?', 'I am fine']
last_turn = turns[-1]
print(f'Last user input: {last_turn}')
ALast user input: How are you?
BLast user input: I am fine
CLast user input: Hello
DLast user input: Hi
Attempts:
2 left
💡 Hint

Look at how negative indexing works in Python lists.

Model Choice
advanced
2:30remaining
Choosing a Model for Long Conversation Contexts

You want to build a chatbot that remembers details from a long conversation (over 1000 words). Which model type is best suited?

AA recurrent neural network (RNN) with gated units like LSTM or GRU
BA small feedforward neural network with no memory
CA simple linear regression model
DA k-nearest neighbors model
Attempts:
2 left
💡 Hint

Think about models that can remember sequences over time.

Metrics
advanced
2:00remaining
Evaluating Conversation Quality with Metrics

Which metric best measures how well a conversation AI keeps track of user intent over multiple turns?

AMean squared error measuring numeric prediction error
BBLEU score measuring word overlap
CPerplexity measuring language model uncertainty
DSlot filling accuracy measuring correct extraction of user details
Attempts:
2 left
💡 Hint

Focus on metrics related to understanding user information.

🔧 Debug
expert
2:30remaining
Debugging Conversation State Update Code

What error does this code raise when updating conversation state?

state = {'topic': 'weather', 'mood': 'happy'}
update = {'mood': 'curious', 'location': 'park'}
state.update(update['location'])
print(state)
ASyntaxError due to missing colon
BKeyError: 'location'
CValueError: dictionary update sequence element #0 has length 1; 2 is required
DNo error, prints updated state with new location
Attempts:
2 left
💡 Hint

Check what type is passed to the update() method.