Amazon interview question

Coding in any language, questions on graphs, trees