NVIDIA interview question

Weird Implementation for stack in c++