0
0
Agentic AIml~20 mins

What is an AI agent in Agentic AI - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
AI Agent Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the role of an AI agent

Which of the following best describes what an AI agent does?

AIt stores large amounts of data without interacting with anything.
BIt senses its environment and takes actions to achieve goals.
CIt only processes images without making decisions.
DIt randomly generates outputs without input.
Attempts:
2 left
💡 Hint

Think about how a robot or virtual assistant works by noticing things and acting.

Predict Output
intermediate
2:00remaining
Output of a simple AI agent simulation

What will be the output of this simple AI agent code that moves in a 1D space?

Agentic AI
class SimpleAgent:
    def __init__(self):
        self.position = 0
    def sense(self, environment):
        return environment[self.position]
    def act(self, perception):
        if perception == 'obstacle':
            self.position -= 1
        else:
            self.position += 1

environment = ['clear', 'clear', 'obstacle', 'clear']
agent = SimpleAgent()
for _ in range(3):
    p = agent.sense(environment)
    agent.act(p)
print(agent.position)
A1
B2
C-1
D0
Attempts:
2 left
💡 Hint

Track the agent's position step by step as it senses and acts.

Model Choice
advanced
2:00remaining
Choosing the right AI agent model for a task

You want to build an AI agent that learns to play a video game by trial and error. Which model type is best suited?

AReinforcement Learning agent
BSupervised Learning classifier
CUnsupervised clustering model
DRule-based expert system
Attempts:
2 left
💡 Hint

Think about learning from rewards and punishments over time.

Metrics
advanced
2:00remaining
Evaluating an AI agent's performance

Which metric best measures how well an AI agent achieves its goals over time?

ASilhouette score
BMean squared error
CPrecision
DCumulative reward
Attempts:
2 left
💡 Hint

Consider a score that adds up all successes and failures during tasks.

🔧 Debug
expert
2:00remaining
Debugging an AI agent's action logic

What error will this AI agent code raise when running?

Agentic AI
class Agent:
    def __init__(self):
        self.state = None
    def act(self, input):
        match input:
            case 'go':
                self.state = 'moving'
            case 'stop':
                self.state = 'stopped'
            case _:
                self.state = 'idle'
agent = Agent()
agent.act('stop')
ATypeError because 'input' is a reserved word
BAttributeError because 'state' is not defined
CSyntaxError due to missing colon after 'case "stop"'
DNo error, code runs fine
Attempts:
2 left
💡 Hint

Check the syntax of the match-case statements carefully.