MEDIUMasked at 6 companies

Minimum Knight Moves

A medium-tier problem at 41% community acceptance, tagged with Breadth-First Search. Reported in interviews at Citadel and 5 others.

Founder's read

Minimum Knight Moves hits your screen and your first instinct is to reach for BFS, but the board is infinite. That's the gotcha. Citadel, Verily, Waymo, and Nvidia have all asked this one, and it catches candidates who don't think past the standard grid-traversal playbook. The acceptance rate sits around 41%, which means the pattern isn't obvious on first read. If this lands in your live assessment and you freeze on how to explore an unbounded space, StealthCoder surfaces the solution in seconds, invisible to the proctor.

Companies asking
6
Difficulty
MEDIUM
Acceptance
41%

Companies that ask "Minimum Knight Moves"

If this hits your live OA

Minimum Knight Moves is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.

Get StealthCoder
What this means

The trick is that a standard BFS on an infinite board will spiral forever. You need to bound the search space by recognizing that any valid knight path has geometric constraints. The optimal solution uses BFS with a smart boundary condition: once you're close enough to the target in terms of move count, you can stop and apply a mathematical formula for the remaining distance. Most candidates try naive BFS, get TLE, and panic. Others hardcode a massive visited set and hope the problem is weak. The real insight is that you can compute a ceiling on the search radius based on Chebyshev distance or Manhattan distance heuristics. BFS handles the irregular knight movement, but you need the bound to make it tractable. StealthCoder handles the edge cases and boundary logic that trip up live candidates.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Minimum Knight Moves recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum Knight Moves interview FAQ

Why doesn't normal BFS work on this problem?+

An infinite chessboard has no natural stopping point. Standard BFS will expand forever searching all possible knight positions. You need to add a boundary condition to the search, either by bounding the exploration radius or by detecting when you can switch to a mathematical formula for the remaining moves.

Is this problem still asked at FAANG-adjacent companies?+

Yes. Citadel, Verily, Waymo, Nvidia, IMC, and LinkedIn have all posted it. The 41% acceptance rate shows it's not a warm-up. It appears in both phone screens and online assessments, usually as a medium-difficulty routing or graph problem.

What's the relationship between Breadth-First Search and knight movement?+

BFS explores states level by level, which maps perfectly to finding the minimum number of moves. Each level represents all positions reachable in exactly N moves. The knight's 8 possible moves become the 8 neighbors you explore from each state. The challenge is bounding the state space, not the BFS itself.

How do I know when to stop searching?+

The key insight is that if you're within a certain distance of the target (roughly 4x the remaining Chebyshev distance), you can compute the exact answer using parity and distance formulas instead of continuing BFS. This dramatically cuts the search space and prevents timeout.

What are the common pitfalls on live assessments?+

Candidates often hardcode arbitrary search bounds, forget to handle negative coordinates, or don't realize the problem needs both BFS logic and mathematical reasoning. Timeout is common if you don't bound the search. Off-by-one errors happen when computing the fallback formula for large distances.

Want the actual problem statement? View "Minimum Knight Moves" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.