0
0
Agentic AIml~20 mins

Branching and conditional logic in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Branching Logic Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of conditional branching in agentic AI decision
What is the output of the following agentic AI decision logic code snippet?
Agentic AI
def agent_decision(score):
    if score > 80:
        return 'High priority'
    elif score > 50:
        return 'Medium priority'
    else:
        return 'Low priority'

result = agent_decision(65)
print(result)
A"Medium priority"
B"No priority"
C"Low priority"
D"High priority"
Attempts:
2 left
💡 Hint
Check which condition the score 65 satisfies in the if-elif-else chain.
Model Choice
intermediate
2:00remaining
Choosing the correct branching model for agentic AI
Which model architecture best supports branching decisions based on multiple conditions in agentic AI?
AA decision tree model
BA convolutional neural network
CA simple linear regression model
DA k-means clustering model
Attempts:
2 left
💡 Hint
Consider which model naturally splits data based on conditions.
Hyperparameter
advanced
2:00remaining
Hyperparameter affecting branching depth in decision trees
Which hyperparameter controls the maximum depth of branching in a decision tree model?
Alearning_rate
Bbatch_size
Cmax_depth
Dn_estimators
Attempts:
2 left
💡 Hint
This hyperparameter limits how many splits the tree can have from root to leaf.
Metrics
advanced
2:00remaining
Metric to evaluate branching decision accuracy
Which metric best measures the accuracy of branching decisions in a classification model?
APerplexity
BAccuracy score
CSilhouette score
DMean squared error
Attempts:
2 left
💡 Hint
This metric counts correct predictions over total predictions.
🔧 Debug
expert
3:00remaining
Debugging incorrect branching in agentic AI code
What error does this agentic AI branching code produce? ```python def agent_response(value): match value: case x if x > 10: return 'High' case x if x > 5: return 'Medium' case _: return 'Low' print(agent_response(7)) ```
Agentic AI
def agent_response(value):
    match value:
        case x if x > 10:
            return 'High'
        case x if x > 5:
            return 'Medium'
        case _:
            return 'Low'

print(agent_response(7))
ASyntaxError due to invalid match-case syntax
B'High' output
C'Low' output
D'Medium' output
Attempts:
2 left
💡 Hint
Check which case matches value 7 first in the match-case with guards.