Adobe Interview Question
Software Engineer / DevelopersAlright....I am not able to draw the figure becoz it doesn't preserves the space.
But my point is, draw a square of Length L at any corner of the squares. where A is the vertex of inner square and C is the vertex of outer square.
then just follow the above procedure...
This solution is not mine but mayank on cc chat. He says that the wooden blocks L can be tilted so that we could use their hypotenuse which is definetely larger than L. It does not matter if the block is a rectangle or square shaped the diagonals is larger and we use them to cross the water.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _D _ _ _ _L _ _ _ _ ( C )
| | |
| L | |
| | |L
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ |______________ |
| | ( A ) | L | ( B )
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| |_ _ _ _ _ _ _ _ _ _ _ _ _ _| |
| |
| |
| |
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
@ Patron not sure it would work...
L/squareroot(2) + L/(2*squareroot(2)) < L doesn't hold TRUE
As given in the problem,the length of the wooden block is L.Therefore,it should also have a width,let us say,"w"(coz it is a wooden block and therefore,is rectangular in shape).
Hence,the diagonal of the wooden block should be definitely greater than L.Hence,the wooden block should be tilted in a manner so that the tips of the diagonal are touching the land of each square.That is what mentioned by prolific.coder
I think we can solve this problem using two logs...
- patron May 21, 2010_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _D _ _ _ _L _ _ _ _ ( C )
| | |
| L | |
| | |L
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ |______________ |
| | ( A ) | L | ( B )
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| |_ _ _ _ _ _ _ _ _ _ _ _ _ _| |
| |
| |
| |
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
As we can see the distance between the squares is L. So it gives us the another square ABCD with sides length L.
now parallel to diagonal BD put a log at a distance slightly less than L/2 from C vertex. after that put another log along AC diagonal .
So that it makes " T " structure.