We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
Backtracking builds a candidate incrementally and undoes the last choice as soon as it cannot lead to a solution - choose, explore, un-choose. Every one of these problems is the same template with a different validity check and a different base case, which is why drilling them as a group pays off so well. The hard part in interviews is pruning early and handling duplicates without producing the same answer twice.
"All permutations/combinations/subsets", or constraint puzzles like N-Queens and Sudoku.
25 problems. Each one runs in an in-browser editor against real test cases, with hints and a worked solution.
The patterns cheat sheet covers all of these in one page - what each one looks like in a problem statement, and the template that follows.