Parent Interview Question

How to optimize the code perfoemance?