
Explain recursion. What are the base case and recursive case, and how would you illustrate the idea with a simple example such as factorial or traversing a binary tree?
Understanding of recursive problem decompositionAbility to explain stopping conditionsReasoning about the call stackApplying recursion to math and tree problemsfactorial(4)Output24WhyThe function multiplies 4 × 3 × 2 × 1, stopping at the base case factorial(0) = 1.max_depth(root)Outputheight of the treeWhyEach call computes depth from the current node by recursively checking its children.