recursion
Applied AI interview questions tagged recursion, across every topic.
10 questions · 0 unlocked for you
Concepts behind "recursion"
The curriculum that explains the ideas these questions test.
Foundational
Recursion and Divide-and-ConquerRecursion solves a problem by calling itself on smaller inputs until a base case stops it; divide-and-conquer is the variant that splits input into independent subproblems, solves each, and combines the results (merge sort, quickselect). Interviews probe it because clean base-case-plus-recursive-step reasoning, an honest read of the call stack, and the bridge from recursion to memoization and dynamic programming separate people who can decompose problems from those who only pattern-match loops.💻 Coding & Engineering Craft
Core
Trees, BSTs, and TraversalA binary tree links each node to up to two children, and a binary search tree adds the invariant that everything left is smaller and everything right is larger, which gives O(log n) search on a balanced tree. The traversal skills interviews test are the three depth-first orders (pre, in, post), breadth-first level order, and switching between recursion and an explicit stack. Applied-AI interviews probe this because in-order traversal of a BST yields sorted output, and the recursion-to-stack conversion is the same skill behind iterative DFS everywhere.💻 Coding & Engineering CraftSign in
Core
BacktrackingBacktracking is systematic search over a tree of partial solutions: at each step you choose an option, explore deeper, and undo the choice before trying the next (choose, explore, unchoose). Pruning kills branches that cannot lead to a valid solution before you waste work on them. Interviews probe it because permutations, combinations, subsets, and constraint problems (N-queens, sudoku) all share this template, and the in-place choose/unchoose pattern avoids re-allocating state at every node, which is the difference between an elegant solution and an exponential memory blowup.💻 Coding & Engineering CraftSign in
