CD PROJEKT RED interview question

Optimize this simple collision project.