Capital One Interview Question

how will you come up with a solution?