X interview question

Discuss the code