IBM interview question

The programming challenge also involved a simple data structures problem.