IBM interview question

Previous experience, regular algorithm questions.