Fast Enterprises interview question

I was asked to do a pseudo code problem.