This question evaluates a candidate's competency in grid-based shortest-path and graph traversal concepts, including modeling a 2D binary grid, handling obstacles, and reasoning about multi-directional neighbor movement.
Given an n x n binary grid, where 0 means open and 1 means blocked, return the length of the shortest path from the top-left cell to the bottom-right cell. You may move in all 8 directions to neighboring cells. A valid path may only pass through open cells. If either endpoint is blocked or no path exists, return -1.