Rehlat interview question

Logic oriented than being program oriented