IMC Trading Interview Question

Doing BFS/DFS on a chess board, stack manipulations.