Infosys interview question

Pattern question