Xebia interview question

Advance JS