BairesDev interview question

Memory management and how to optimize it