Bird
0
0

Identify the error in this routing condition:

medium📝 Debug Q6 of 15
LangChain - LangGraph for Stateful Agents
Identify the error in this routing condition:
conditions = [lambda ctx: ctx['score'] > 50, lambda ctx: ctx['score'] < 50]
AConditions overlap causing ambiguity
BNo condition covers score exactly 50
CLambda syntax is incorrect
DContext key 'score' is misspelled
Step-by-Step Solution
Solution:
  1. Step 1: Analyze condition coverage

    First condition covers scores > 50, second covers < 50, but 50 itself is not covered.
  2. Step 2: Check other options

    Lambda syntax is correct, conditions do not overlap, and 'score' key is spelled correctly.
  3. Final Answer:

    No condition covers score exactly 50 -> Option B
  4. Quick Check:

    Missing coverage for score=50 [OK]
Quick Trick: Check if all possible values are covered [OK]
Common Mistakes:
MISTAKES
  • Thinking lambda syntax is wrong
  • Assuming conditions overlap
  • Ignoring missing exact value coverage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes