AppsFlyer Interview Question

A heap question, and Dynamic Programming