Explain how depth-first search and breadth-first search traverse a graph, and their applications
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: easy
Interview Round: Other
Overview: Explain how depth-first search and breadth-first search traverse a graph and which problems each one solves. Tests the stack versus queue distinction, visited tracking, complexity on adjacency lists, and picking a traversal for shortest paths, cycles or ordering.