awesome-everything RU
↑ Back to the climb

Algorithms from zero

Recursion & backtracking: interview drill

Crux Timed backtracking problems from the NeetCode-150, with progressive hints — solve each cold, then narrate the complexity.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 120 min

You understand backtracking. Interviews test whether you can reach for it under a timer, cold, and explain the cost out loud.

Goal

Solve each problem before you reveal a hint, hit the target time, and narrate the time and space complexity as if an interviewer were listening. The hints exist for when you are genuinely stuck — they nudge you toward the pattern, never the full solution.

Five NeetCode-150 problems on the backtracking pattern this unit teaches. Set a timer, solve each cold without looking at a hint, then say the time and space complexity out loud before you move on. Reveal a hint only when you are truly stuck — the hints nudge, they never hand you the answer.

0/5 solved

backtracking

#78 SubsetsMedium15m
AmazonMeta
Follow-up (aloud)

There are 2^n subsets. Justify the O(n·2^n) time and explain where the extra factor of n comes from.

#39 Combination SumMedium20m
Amazon
Follow-up (aloud)

Why does passing 'start' rather than letting the recursion pick any index prevent permutations of the same combination?

#46 PermutationsMedium15m
AmazonMicrosoft
Follow-up (aloud)

There are n! permutations — narrate the time bound and contrast it with the 2^n of subsets.

#22 Generate ParenthesesMedium20m
AmazonGoogle
Follow-up (aloud)

The count of valid strings is the nth Catalan number. You don't need the formula — but why does pruning invalid prefixes matter for the real cost?

#79 Word SearchMedium20m
AmazonMicrosoft
Follow-up (aloud)

Give the worst-case time as O(m·n·4^L) and define L; explain why the visited-restore step keeps space at O(L).

Recap

Mark each problem solved once you finished it cold, inside the target time, and could state the complexity without hesitation. Come back in a few days and re-solve the ones you marked — spaced revisits are what turn a recognised pattern into a reflex.

Continue the climb ↑Hash maps and hash sets
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources2
expand
  1. 01
  2. 02

Trademarks belong to their respective owners. Editorial reference only.