NVIDIA interview question

When to use Stack vs Heap memory