Pergunta de entrevista da empresa Arm

Describe how the memory in a computer works. How many registers are there in general in computer. I also got a code snippet and was asked to explain how an optimizing compiler would optimize the code