Question d’entretien chez American Express

How to make this code secure based on a use case?