Capital One Interview Question

What is this code doing?