Infosys interview question

To code on a board.