Pregunta de entrevista de IBM

Previous experience, regular algorithm questions.