Google interview question

Simple starter but increases difficulty in improving an algorithm