0
0
Prompt Engineering / GenAIml~20 mins

Chatbot development basics in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Chatbot Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Intent Recognition in Chatbots

Which of the following best describes the role of intent recognition in a chatbot?

AIt translates user messages into multiple languages.
BIt generates the chatbot's response text based on user input.
CIt stores the conversation history for future reference.
DIt identifies the user's goal or purpose behind their message.
Attempts:
2 left
💡 Hint

Think about what the chatbot needs to understand before replying.

Predict Output
intermediate
2:00remaining
Output of Simple Rule-Based Chatbot Code

What will be the output of the following Python code snippet?

Prompt Engineering / GenAI
def chatbot_response(message):
    if 'hello' in message.lower():
        return 'Hi there! How can I help you?'
    else:
        return 'Sorry, I did not understand.'

print(chatbot_response('Hello, bot!'))
Ahello
BHi there! How can I help you?
CSorry, I did not understand.
DNone
Attempts:
2 left
💡 Hint

Check if the word 'hello' is detected in the input message.

Hyperparameter
advanced
2:00remaining
Choosing Embedding Size for Chatbot NLP Model

When training a chatbot's natural language understanding model, which embedding size is generally best for balancing performance and speed?

A5 dimensions
B5000 dimensions
C50 dimensions
D10000 dimensions
Attempts:
2 left
💡 Hint

Too small loses meaning, too large slows training.

Metrics
advanced
2:00remaining
Evaluating Chatbot Response Quality

Which metric is most appropriate to measure how well a chatbot's responses match expected answers in a classification task?

AAccuracy
BMean Squared Error
CBLEU Score
DRoot Mean Squared Error
Attempts:
2 left
💡 Hint

Think about classification vs. text similarity metrics.

🔧 Debug
expert
2:00remaining
Debugging Chatbot Response Generation Code

What error will this Python code raise when run?

Prompt Engineering / GenAI
def generate_response(user_input):
    responses = {'hi': 'Hello!', 'bye': 'Goodbye!'}
    return responses[user_input]

print(generate_response('hello'))
AKeyError
BTypeError
CSyntaxError
DIndexError
Attempts:
2 left
💡 Hint

Check if the key 'hello' exists in the dictionary.