Google interview question

Q. Dynamic Programming and Tree related.