Amazon interview question

something like regression and BFS.