IBM interview question

some puzzles