Recursion and Backtracking Questions
Recursive decomposition, base/recursive-case design, and backtracking search over combinatorial spaces (permutations, subsets, constraint satisfaction, N-queens style problems). Covers recursion-tree reasoning, pruning, and converting recursion to iteration. The conceptual bridge into dynamic programming and search.
Flatten nested lists: implement a Python generator that takes arbitrarily nested lists of integers (e.g., [1, [2, [3, 4], 5], 6]) and yields integers one at a time without building a full flat list in memory. Explain recursion vs iterative stack-based approaches.
Flatten a nested dictionary into a list of dotted paths for keys. For example: {'a': {'b': 1, 'c': {'d':2}}, 'e': 3} -> ['a.b', 'a.c.d', 'e']. Implement a Python function that yields paths as it walks the structure and handles deep nesting without recursion depth issues.
That is every published Recursion and Backtracking question for Data Engineer so far. Browse the other topics in this category, or practice this one interactively.