Chessboard

problem: using 31 dominoes, where one domino covers exactly two squares, can you cover all the empty squares on this chessboard (which has 62 spaces). if so, how? if not, why?   

Solution

i think everyone’s first inclination is to try and figure out how it is possible. then again, if you’ve heard a bunch of these questions before, you usually know that if the question says “if not, why?” or “prove whether its possible or impossible”, you can infer that it is not possible (otherwise, the question usually just asks for the solution).

after awhile fiddling around with the dominoes, you will start to realize that the most obvious solutions are not viable. if you start to think its impossible, think about why.

a reader emailed me telling me that using the picture of the chessboard without the squares colored will result in a very small percentage of people solving the problem. if i use the following picture

chessboard

a much higher percentage of people will be able to solve the problem. the people who solve the problem using only the grid, usually represent the problem in their heads as the colored board.

still can’t figure it out? using the colored board, remember that a domino always covers a black square and a white square.

if you look at the board, you will see that the two squares missing are both black. this means that for all the squares on the board, each white square has a corresponding black square, except for two white ones. so even if you covered all the black/white pairs, you would still be left with two white squares, which will never be adjacent to each other, no matter how you lay out the dominoes.

2026 Update: Chessboard Problems — Combinatorics and Graph Theory

Chessboard problems test spatial reasoning, graph modeling, and combinatorics. Classic variants:

# Problem 1: Can you tile an 8×8 board (minus 2 opposite corners) with dominoes?
# Answer: NO. Opposite corners are same color. Dominoes always cover one black + one white.
# With 2 same-colored corners removed: 32 black, 30 white (or vice versa) → impossible.

def domino_tiling_possible(n, m, removed_squares):
    """
    Check if n×m board with removed squares can be tiled with 1×2 dominoes.
    Uses coloring argument: count black vs white squares.
    """
    # Standard chessboard coloring
    black = (n * m + 1) // 2 - sum(1 for r, c in removed_squares if (r+c) % 2 == 0)
    white = (n * m) // 2 - sum(1 for r, c in removed_squares if (r+c) % 2 == 1)
    # Necessary condition: equal black and white (not sufficient in general)
    return black == white

# 8×8 minus opposite corners (0,0) and (7,7) — both same color
print(domino_tiling_possible(8, 8, [(0,0), (7,7)]))  # False

# 8×8 minus (0,0) and (0,1) — different colors
print(domino_tiling_possible(8, 8, [(0,0), (0,1)]))  # True

# Problem 2: Knight's tour — Hamiltonian path on chessboard graph
def knights_tour(n=5):
    """Find a knight's tour on n×n board using Warnsdorff's heuristic."""
    moves = [(2,1),(2,-1),(-2,1),(-2,-1),(1,2),(1,-2),(-1,2),(-1,-2)]

    def valid(x, y, visited):
        return 0 <= x < n and 0 <= y < n and (x,y) not in visited

    def degree(x, y, visited):
        return sum(1 for dx,dy in moves if valid(x+dx, y+dy, visited))

    def solve(x, y, visited, path):
        if len(path) == n*n:
            return path
        neighbors = [(x+dx, y+dy) for dx,dy in moves if valid(x+dx, y+dy, visited)]
        # Warnsdorff: always move to square with fewest onward moves
        neighbors.sort(key=lambda p: degree(p[0], p[1], visited))
        for nx, ny in neighbors:
            visited.add((nx, ny))
            result = solve(nx, ny, visited, path + [(nx,ny)])
            if result:
                return result
            visited.discard((nx, ny))
        return None

    visited = {(0, 0)}
    tour = solve(0, 0, visited, [(0,0)])
    return tour

tour = knights_tour(5)
print(f"5×5 knight's tour found: {tour is not None}")  # True

# Problem 3: N-Queens on chessboard (see our dedicated post)
# Problem 4: Bishops on 8×8 — max non-attacking bishops?
# Answer: 14 (2*(n-1) for n×n board, all on edge squares of alternating colors)
print(f"Max non-attacking bishops on 8×8: {2*(8-1)}")  # 14

Interview insight: Chessboard problems test whether you can model a 2D problem as a graph. The coloring argument (domino tiling) is a proof technique that generalizes to many impossibility proofs. Knight’s tour = Hamiltonian path problem = NP-complete in general, but heuristics (Warnsdorff’s rule) work well on regular boards.

💡Strategies for Solving This Problem

Grid-Based Problems

Chessboard problems usually involve placing pieces, counting paths, or solving puzzles. Common themes:

Common Chessboard Problems

1. N-Queens: Place N queens on N×N board so none attack each other

2. Knight's Tour: Visit every square exactly once with knight moves

3. Minimum Knight Moves: Shortest path from (0,0) to (x,y)

4. Unique Paths: Count paths from top-left to bottom-right

N-Queens Solution

Classic backtracking problem. Try placing queens row by row. For each row, try each column. Check if placement is valid (no attacks). If valid, recurse to next row. If we reach last row, found solution.

O(N!) time - lots of branches but heavy pruning.

Knight Minimum Moves

BFS from start to target. Knight moves in L-shape: (+2,+1), (+2,-1), (-2,+1), (-2,-1), (+1,+2), (+1,-2), (-1,+2), (-1,-2).

Each position is a state, BFS finds shortest path.

O(x² + y²) time for reaching (x,y).

Scroll to Top