ZeMoSo interview question

write code for DFS , BFS