Ford Motor Company Interview Question

Robot moving in a nxn matrix