Leetcode 51. N-Queens
Place n queens on an n×n chessboard so no two queens share a row, column, or diagonal, and return all distinct board configurations. This is a classic combinatorial search / backtracking problem that explores permutations with diagonal pruning (n ≤ 9).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early August, 2026
Last question of a technical interview, spent about 5min walking through an approach, no coding. Given 8 queens and a chessboard, how would you find a valid placement such that the queens cannot capture any of the others?
Early June, 2026
Place n queen in nxn chessboard
Hello Interview Premium
Your account is free and you can post anonymously if you choose.