Accenture interview question

this technical interview is more like live coding interview