Uber interview question

Coding questions related to two points on a 2D grid