Hexaware Technologies interview question

Two questions about some random puzzles