Nokia interview question

Basic OOPS concepts. Some algorithms.