Adyen Interview Question

Basic dynamic programming problem, an sql problem and a design problem.