ThoughtWorks Interview Question
Web Developersknap's soln is the best:
_ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
_ _ _ _ _ _ _ _
|1|1|1|1|1|1|1|1|
|1|1|1|1|_ _ _ _
_ _ _ _|2|2|2|2|
|2|2|2|2|2|2|2|2|
_ _ _ _ _ _ _ _ _ _ _ _
|1|1|1|1|1|1|1|1|2|2|2|2|
|1|1|1|1|2|2|2|2|2|2|2|2|
ignore all above solution:
Good Answer: Cut 4 pieces of length 3 along the edge of length 8.
Align them horizontally. 4x3=12 and 4 pieces along length 8 is size 2 each
to make clear
3 vertical original
8 horizontal original
cuts are shown
_________________________
| | | | |
_________________________
knap's soln is the best:
_ _ _ _ _ _ _ _
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
|_|_|_|_|_|_|_|_|
_ _ _ _ _ _ _ _
|1|1|1|1|1|1|1|1|
|1|1|1|1|_ _ _ _
_ _ _ _|2|2|2|2|
|2|2|2|2|2|2|2|2|
_ _ _ _ _ _ _ _ _ _ _ _
|1|1|1|1|1|1|1|1|2|2|2|2|
|1|1|1|1|2|2|2|2|2|2|2|2|
Assuming each square piece being of 1 x 1 size and a normal co ordinate system. Draw a vertical line from (0,1) to (4,1) then to ((4,2) and then all the way up to (8,2). Slide the pieces to fit.
- knap August 07, 2009