0
0
Agentic AIml~20 mins

ReAct pattern (Reasoning + Acting) in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ReAct Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the core idea of ReAct pattern
What is the main advantage of combining reasoning and acting in the ReAct pattern for AI agents?
AIt allows the agent to alternate between thinking and taking actions, improving decision-making in complex tasks.
BIt enables the agent to skip reasoning and act immediately, saving time in all scenarios.
CIt forces the agent to only reason without ever taking actions, ensuring perfect planning.
DIt makes the agent act randomly without any reasoning, increasing exploration.
Attempts:
2 left
💡 Hint
Think about how combining thinking and doing helps solve problems step-by-step.
Predict Output
intermediate
2:00remaining
Output of a simple ReAct agent step
Given the following simplified ReAct agent code snippet, what will be the printed output after one reasoning and acting cycle?
Agentic AI
class SimpleReActAgent:
    def __init__(self):
        self.state = 0
    def reason(self):
        return f"Reasoning with state {self.state}"
    def act(self):
        self.state += 1
        return f"Acting to change state to {self.state}"
    def step(self):
        thought = self.reason()
        action = self.act()
        print(thought)
        print(action)
agent = SimpleReActAgent()
agent.step()
A
Reasoning with state 0
Acting to change state to 1
B
Reasoning with state 1
Acting to change state to 1
C
Acting to change state to 1
Reasoning with state 0
D
Reasoning with state 0
Reasoning with state 1
Attempts:
2 left
💡 Hint
Check the order of reasoning and acting in the step method.
Model Choice
advanced
2:00remaining
Choosing the best model for ReAct pattern
Which type of AI model is most suitable to implement the ReAct pattern effectively in a natural language task?
AA simple feedforward neural network without memory or sequential output capabilities.
BA convolutional neural network designed for image classification.
CA large language model with the ability to generate reasoning traces and actions sequentially.
DA clustering algorithm that groups data points without generating text.
Attempts:
2 left
💡 Hint
Consider which model can produce step-by-step reasoning and actions in text.
Metrics
advanced
2:00remaining
Evaluating ReAct agent performance
Which metric best captures the effectiveness of a ReAct agent in completing multi-step reasoning and acting tasks?
ATraining loss on a single-step classification task.
BTask success rate measuring how often the agent completes the task correctly.
CNumber of parameters in the model.
DTime taken to load the model into memory.
Attempts:
2 left
💡 Hint
Think about what shows the agent actually solves the task well.
🔧 Debug
expert
3:00remaining
Debugging a ReAct agent stuck in infinite reasoning
A ReAct agent repeatedly outputs reasoning steps without ever acting, causing an infinite loop. Which is the most likely cause?
AThe agent's state variable is incremented too quickly, skipping reasoning.
BThe agent's act() method is called but returns None, which is ignored.
CThe agent's reasoning method returns an empty string, causing a crash.
DThe agent's code never calls the act() method after reasoning, so it never performs actions.
Attempts:
2 left
💡 Hint
Check if the acting step is actually executed after reasoning.