Sollicitatievraag bij Optum

How would you code this in a different language? How could you make the code a bit more secure to handle invalid inputs? Explain a technical problem you face when doing a project and how you went about to resolve the problem?