Sollicitatievraag bij American Express

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