PayPal interview question

Binary Tree, dynamic programming, recursion, Design patterns