The Problem
Here's an interesting interview question I thought of on my way home from a party recently.
- You are parked at some starting point
SP
which is between 2 exitsE1 and E2
- We were at a cross road with Road 1
R1
at ourSP
- Our starting point is set between exit 1 and exit 2 on the highway
E1 and E2
of road 2R2
- To reach our destination we must reach exit 4
E4
which is pastE2
- Speed limit of
R1
= 25,R2
= 50 (double)
??? When will going to E1 be faster ???
From SP
at which distance is it faster to go back to E1
instead of going forward to E2
.
The Solution
Note that:
D1 = D3 - D2
(i.e. D2 is always a shorter distance)D2
andD1
both have the same speed (R1
),D3
is double ( or .5 the distance )- Since
R2
is 2x the speed ofR1
it will take half as long to travel - If
S1
is closer than half way thenD1
will always be faster thanD3
alone. Meaning the faster route is determined before the car arrives atE1
- In the same vein, for
E1
to be faster the car needs to arrive before it would have reached1/2 * D3
) - Since they travel at the same speed if
S1
if 1/4 of the way betweenE1
andE2
, and it would reachE1
at the same time that it would reach1/2 * D3
(i.e.< 1/4 of D3
)
In Conclusion
Its about how the interviewee answers the question, not the answer they give.
So, take note of the interviewees thought process while solving the problem.
Remember: The question is better when you word it like I did.
Do not say Which route is faster.
That is not the question, it is When is going backward faster.
This will force the interviewee to use a logical thought instead of a geometrical.