Qualtrics Interview Question

Got a well known DP problem.