X Interview Question

First question was based on DP