Infosys interview question

logical reasoning