Bose interview question

How to do BFS and DFS?