Spotify Interview Question

How does the stack v heap work?