Tesla interview question

How do you diagnose a fault? Implement a depth first search algorithm.