HARMAN Interview Question

Programming logic and how to handle if it have errors