Barclays interview question

compiler optimisation tricks to organise memory layout of objects