Newgen Software interview question

Puzzle