WorkIPO Interview Question

How do you optimize code for performance? Can you provide an example?