Google interview question

Basic algorithms and programming.