Deloitte Interview Question

How can you improve this code?