Capital One interview question

some coding questions, not easy