Block interview question

OOP, graph traversal