Bloomberg Interview Question

I was been on Graphs and Backtracking