A Question That Should Not Be Asked In Interviews

Given a board that is n x n squares, where n is a power of 2, and that has one square removed from an arbitrary position, give an algorithm to completely cover the board with L shaped tiles made from three adjacent unit squares. An 8×8 board is shown in the figure; one removed square is shown in black; one L shaped green tile is placed on the board. Remember that the tiles can be placed in any orientation.



Interview Question

A C language macro to compute maximum of two ints is generally written as
#define  max(a,b)   (a > b? a : b)
Now write it without using the ternary operator “?:”

Hint: This is inspired by puzzle #160 in Nick’s Puzzles — An excellent site, also gives hints and solutions.