Capital One interview question

What is this code doing?