NVIDIA interview question

Typical OOP design problem.