Spotify Interview Question

How does Java garbage collection work?