Infosys interview question

There were some tricky puzzles.