This is a solution to problem 5 on the hard interview questions node. If you have not read the question, the following will make no sense to you:

Here's a hint: what does every line that cuts a rectangle in half have in common (something simple)? If you want the full solution, read on:

Every line that cuts a rectangle in half passes through the center of the rectangle. There are infinite such lines for every rectangle. However, there is exactly one line that passes through the centers of both rectangles, the cake and the hole in it -- that is, of course, unless they share a common center. This line divides both rectangles exactly in half, and this is the line along which you make the cut.

This is a smartass solution to problem 5 on the hard interview questions node. Cut the cake midway between its base and its top, parallel to the base it's set on. This, of course, is also one of the steps to cut a cake in 8 pieces with 3 cuts.

Log in or register to write something here or to contact authors.