Smoothstack interview question

It was a coding interview.