EarnIn interview question

CS fundamental knowledge.