Geniebook interview question

My answer in technical test