Spotify interview question

How does the stack v heap work?