Google Interview Question

Q. Dynamic Programming and Tree related.