Category: Backtracking & Recursion

Backtracking interview problems in Python: subsets, permutations, combination sum, parentheses and grid search, with a reusable template and tested code.

Backtracking is how you search through every possible choice without writing a separate loop for each one. You build a candidate step by step, undo the last step when it leads nowhere, and then try the next option. Subsets, permutations, combination sums and word searches all share this shape, which is why a single template covers so many interview questions. The guide in this category explains that template in Python, shows how to avoid duplicate results when the input contains repeated values, and explains how to estimate the running time, which is often exponential and has to be justified rather than hidden. Start there if you have only met recursion on simple examples such as factorials. When a brute-force search keeps repeating the same sub-problems, move on to the dynamic programming guides, because memoization is often the next step.