Investment Banking puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 36
- Topics
- 12
- Hard
- 29
055How many squares of any size are there on an 8 x 8 chessboard?Bulge bracket IBMiddle market IB
Try it first
Before you count: how many squares are on the board?
Show the worked solution
204 squares. A square of side k can start in (9 minus k) columns and (9 minus k) rows, so there are 64 squares of size 1, 49 of size 2, 36 of size 3, and so on down to a single 8 x 8. The total is the sum of the first eight square numbers, 1 + 4 + 9 + ... + 64, which is 204.
How do you count one size without listing every square?
Picture sliding a 3 x 3 photo frame across the board. Its left edge can sit on column 1, 2, 3, 4, 5 or 6; on column 7 it would hang off the side. That is 6 positions across and, by the same logic, 6 down. Count where a square's top-left corner can sit, not the squares themselves: a k x k square has (9 minus k) choices in each direction, so (9 minus k) squared positions. For k = 3 that is 36, for k = 7 it is 4, and the whole board is the single 8 x 8.
A 3 x 3 square can start in 6 columns and 6 rows, 36 positions, and the same rule gives 64, 49, 36, 25, 16, 9, 4 and 1 squares for sizes 1 to 8, adding to 204 squares on the board. How do you add 64 + 49 + ... + 1 quickly?
Add from the top and say the running total: 64 and 49 is 113, plus 36 is 149, plus 25 is 174, plus 16 is 190, then 9, 4 and 1 take it to 204. If you know the formula for a sum of squares, use it as a check rather than a starting point. The interviewer scores the moment you see that each size contributes a square number, not the formula you remember.
The relationshipk the side of the square, from 1 to 8 9-k the starting positions in one direction for that size m^2 the same sum written from the 8 x 8 upwards What it says in wordsCount the positions for each size, then add the first eight square numbers.Why is 1,296 the wrong answer here?
1,296 is the number of rectangles of every shape. A rectangle is fixed by choosing two of the 9 vertical grid lines and two of the 9 horizontal ones, 36 ways each, and 36 x 36 is 1,296. Squares are the rectangles whose two sides are equal, which is why the count falls from 1,296 to 204. Offering that link unprompted shows you understand the counting rather than a memorised trick.
Where candidates lose it
The quick answers are 64 and 65. Both stop at the obvious squares and miss that a 2 x 2 or a 5 x 5 square can sit in many places. The question is rated hard precisely because the first answer feels complete.
The other loss is listing positions by hand for each size and running out of time. State the rule, (9 minus k) squared, once, then add the eight numbers out loud.
What the interviewer asks next
- How many rectangles of any size are on the board?
- What is the general formula for an n x n board?
- How many squares are on a 10 x 10 board?
