Magnasoft interview question

Problem Solving , Reasoning and technical question