Daffodil Software interview question

They asked different ways to optimize the code