Pregunta de entrevista de Amazon

Implement directed graph as a class?