Pergunta de entrevista da empresa Amazon

One question was based on trees and the other on dynamic programming.