Traveloka interview question

Logic question and android specific question.