Parent interview question

How to optimize the code perfoemance?