0
0
Prompt Engineering / GenAIml~20 mins

Agent architecture (observe, think, act) in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Agent Architect Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding the 'Observe' step in agent architecture
In the agent architecture model, what is the primary role of the 'Observe' step?
ATo decide the best action based on past experiences
BTo collect data from the environment through sensors or inputs
CTo execute actions that change the environment
DTo store the results of previous actions for future use
Attempts:
2 left
💡 Hint

Think about how an agent first learns about its surroundings.

Predict Output
intermediate
1:30remaining
Output of agent decision-making code snippet
What will be the output of the following code simulating an agent's 'Think' step?
Prompt Engineering / GenAI
environment_data = {'temperature': 30, 'light': 'bright'}

# Agent thinks based on temperature
if environment_data['temperature'] > 25:
    action = 'turn_on_cooler'
else:
    action = 'do_nothing'

print(action)
Aturn_on_cooler
Bdo_nothing
CKeyError
DSyntaxError
Attempts:
2 left
💡 Hint

Check the temperature value and the condition in the if statement.

Model Choice
advanced
2:00remaining
Choosing the best model for the 'Act' step in an agent
Which type of model is most suitable for the 'Act' step where an agent must perform actions in a continuous environment?
ALinear regression model
BUnsupervised clustering model
CAutoencoder neural network
DReinforcement learning policy network
Attempts:
2 left
💡 Hint

Consider models that learn to make decisions based on rewards.

Metrics
advanced
2:00remaining
Evaluating agent performance metrics
Which metric best measures how well an agent balances exploring new actions and exploiting known good actions during learning?
AExploration rate (epsilon) in epsilon-greedy policy
BPrecision of classification
CMean squared error of predictions
DCumulative reward over time
Attempts:
2 left
💡 Hint

Think about the parameter controlling randomness in action choice.

🔧 Debug
expert
2:30remaining
Debugging an agent's 'Think' step causing wrong action
Given the code below, why does the agent always choose 'do_nothing' even when the temperature is 30?
Prompt Engineering / GenAI
environment_data = {'temperature': 30}

# Agent thinks and decides action
if environment_data['temperature'] < 25:
    action = 'turn_on_cooler'
else:
    action = 'do_nothing'

print(action)
AThe dictionary key 'temperature' is misspelled causing a KeyError
BThe agent lacks an 'Observe' step to get temperature data
CThe condition is reversed; it should be '>' instead of '<' to turn on the cooler when hot
DThe print statement is outside the if-else block causing no output
Attempts:
2 left
💡 Hint

Check the logic condition comparing temperature to 25.