This was the last question of the final exam and, despite its name, had nothing to do with self-driving cars.
My answers were totally correct.
It is more like a simple IQ question about the path of a car that must reach three different destinations: A, B and C.
The cost of each move, from one square to the following, is 1. The cost of turning 90 degrees to the right is also 1, while the
cost of a left turn is 14.
So what are the paths that minimize the total cost? For A and C the answer is trivial: it is the most direct path to the destination.
But for B the situation is totally different. In fact, if we go straight, then turn to the left, the total cost will be 20, while if we
run through a longest path, the cost will be 19.
You can see all three paths in the Java animation here above, superimposed to the actual question screen.
|