Amazon interview question

Implement directed graph as a class?