NVIDIA interview question

Code review and comment on the performance improvement on the code