Adobe Interview Question

Mostly on Graphs and Trees