Amazon Interview Question

For any problem how to decide which algorithm to use from BFS and DFS?