Google interview question

A dp+binary search question and a tree dp question