Challenge - 5 Problems
Tree-of-thought Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What is the main advantage of using a tree-of-thought approach in AI decision-making?
Consider an AI agent facing a complex problem with many possible steps. What is the main advantage of using a tree-of-thought approach compared to a simple linear reasoning process?
Attempts:
2 left
💡 Hint
Think about how exploring different paths helps in complex problems.
✗ Incorrect
The tree-of-thought approach lets the AI consider many possible reasoning paths, helping it find better solutions by comparing options rather than following just one path.
❓ Predict Output
intermediate2:00remaining
What is the output of this tree-of-thought simulation code?
Given the following Python code simulating a simple tree-of-thought search, what will be printed?
Agentic AI
def tree_search(node, depth): if depth == 0 or not node['children']: return node['value'] results = [] for child in node['children']: results.append(tree_search(child, depth - 1)) return max(results) root = { 'value': 0, 'children': [ {'value': 3, 'children': []}, {'value': 5, 'children': [ {'value': 2, 'children': []}, {'value': 7, 'children': []} ]}, {'value': 1, 'children': []} ] } print(tree_search(root, 2))
Attempts:
2 left
💡 Hint
The function returns the maximum value found up to the given depth.
✗ Incorrect
The search explores children up to depth 2. The maximum value among children and grandchildren is 7, so the output is 7.
❓ Hyperparameter
advanced2:00remaining
Which hyperparameter most directly controls the breadth of exploration in a tree-of-thought search?
In a tree-of-thought AI system, which hyperparameter controls how many different reasoning paths the system explores at each step?
Attempts:
2 left
💡 Hint
Think about how many child nodes are considered at each decision point.
✗ Incorrect
The branching factor sets how many child nodes (paths) are explored from each node, controlling the breadth of the search tree.
❓ Metrics
advanced2:00remaining
Which metric best evaluates the quality of decisions made by a tree-of-thought AI agent?
When assessing a tree-of-thought AI agent solving complex problems, which metric best measures how good the final decisions are?
Attempts:
2 left
💡 Hint
Focus on the quality of the solution, not the resource usage.
✗ Incorrect
Accuracy of the final solution shows how well the AI's decisions match the correct or desired answers, which is the key quality metric.
🔧 Debug
expert3:00remaining
Why does this tree-of-thought search code get stuck in an infinite loop?
Examine the code below. Why does the tree-of-thought search get stuck and never finish?
Agentic AI
def search(node, visited=None): if visited is None: visited = set() if node['id'] in visited: return None visited.add(node['id']) if not node['children']: return node['value'] results = [] for child in node['children']: results.append(search(child, visited)) return max(filter(None, results)) node_a = {'id': 'A', 'value': 1, 'children': []} node_b = {'id': 'B', 'value': 2, 'children': [node_a]} node_a['children'] = [node_b] print(search(node_a))
Attempts:
2 left
💡 Hint
Consider how cycles in the graph affect recursion and visited nodes.
✗ Incorrect
The visited set is shared across all recursive calls, so when a cycle exists, nodes are revisited causing infinite recursion. Proper cycle detection requires careful handling of visited nodes per path.