Nokia interview question

Solving some programming problems.