X interview question

How would you implement Depth First Search for a graph?