Amazon Interview Question

Coding in any language, questions on graphs, trees