KAYAK Interview Question

Mars rover problem.