IBM interview question

standard data structure and algorithm stuff