Mphasis interview question

Not easy