Amazon interview question

Tree reversal, linked list, DP