PayPal interview question

Tree, graph and DP problems