BRAC IT Services interview question

When should we use BFS and when DFS, explain with example