AppNeta Interview Question

How does garbage collection work in the JVM