Pregunta de entrevista de Spotify

How does the stack v heap work?