Capital One interview question

how will you come up with a solution?