How do you solve a Sudoku board with backtracking?
PICTURE THIS: HOW TO EXPLAIN IT
Simple meaning
Find the next empty cell, try digits 1-9 that do not clash in row, column, or 3x3 box, and recurse
WHY — Recursion instead of guessing?
Why interviewers care about Recursion:
question about Recursion.
trade-offs, and what you would actually do on a DSA project - not buzzwords.
Name the idea, why it exists, then one short example.
End with when you use it and one common pitfall.
STEPS — What happens step by step?
Before you speak the answer, walk the interviewer through these steps:
- 1Find the next empty
cell, try digits 1-9 that do not clash in row, column, or 3x3 box, and recurse
- 2Why it exists
undo on failure.
- 3How it works
Worst case is exponential
- 4space is O(1) extra
besides the board if you mutate in place, or O(81) recursion depth.
- 5Bitsets for each row/col/box
make validity O(1).
- 6Close
When you pick this over the alternative.
EXAMPLE — See it in action
Here's a short line you can speak, broken into clear beats:
Note: Adapt this scaffold to your own project — keep it under 60–90 seconds.
Key takeaway
Find the next empty cell, try digits 1-9 that do not clash in row, column, or 3x3 box, and recurse undo on failure.