Meta interview question

It was a typical coding question. Nothing too complicated