Pergunta de entrevista da empresa Intel Corporation

When it is better to use stack variable instead of heap variable?