Citadel Securities Interview Question

A problem on travelling across a grid.