How the question is posed really matters.  What if the question had been &quot;hey, you have a starting node in a linked structure, and you want to visit &#x2F; collect &#x2F; search all of the nodes that it can reach, without duplicates&quot;, you&#x27;d probably come up with DFS or BFS on the spot because the problem is not that hard and those are really the only two ways to attack it, and having found one of the two you&#x27;d probably also realize that the other approach could have been used.  Whereas, if just asked to implement DFS or BFS, the question becomes less about problem solving aptitude and more about memorization.