Amazon Interview Question

something like regression and BFS.