Graphical and Spatial Problems
Diagramming and visualization are the keys to solving the following brainteasers.
Boat and Dock
You should begin this problem by drawing a diagram, both to ensure you understand the scenario and to get you started on the solution. The edge of the pier, the water, and the rope form the legs of a right triangle, as shown in Figure 15-1. To facilitate further discussion, these segments are labeled A, B, and C, respectively.
Here you have something familiar but with an unusual twist. You’ve probably worked with right triangles ad nauseam in your math classes, but those were static shapes. This triangle is collapsing. Be wary of this difference. Although it seems minor, it may be enough to make the wrong answer seem intuitively correct.
Given your experience with right triangles, you may decide to attack this problem mathematically. You need to determine whether side B or side C gets shorter ...
Get Programming Interviews Exposed: Secrets to Landing Your Next Job, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.