NVIDIA interview question

As a developer how would you prevent segmentation fault.