com/profile/Abhimanyu-Sood-2/answers/Interviewing
Now, lets try to visualize the path of the bug. The question states that it will always be
moving towards one of the cars. But the cars themselves are moving. So, bugs path
would not be a straight line. It would be a complicated spiral like path. Plus, the cars are
not moving at constant velocity. They are accelerating, this will further complicate the
spiral path.
So, the approach is clear. We need to find mathematical equation corresponding to bugs
path for one cycle. Then we can simply calculate the distance from this equation and a
little integral calculus. Then multiply the answer with the number of cycles.
But how to calculate the equation of the complicated spiral path?
My thoughts I think this question (and its solution) provides a profound description of life itself. Most
of the times, we face situations that seem hopelessly complicated. There seems to be no
way out.
But once you hack away the outer layers - parts that are unimportant, parts that are
irrelevant to the final solution, parts that are only present there to complicate the
situation, you reach the core. And the core is beautiful, with an elegance that is signified
by its sheer simplicity.
PS:
I regularly write interview related answers. You can view the viral ones here
-https://www.quora.com/profile/Ab...