Pergunta de entrevista da empresa Google DeepMind

What's the difference between stack and heap, when would you use one and when the other?