WorkIPO interview question

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