Amazon Interview Question

Implement directed graph as a class?