Ralali.com interview question

Explain the code