Explain Java Automatic Memory Management: Heap, Reachability and Garbage Collectors
Company: State
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Online Assessment
Overview: Describe how Java manages memory automatically, from object allocation on the heap to how the JVM decides which objects are unreachable and reclaims them. The question tests knowledge of garbage collection algorithms, generational collection, collector trade-offs and how memory leaks still happen in Java programs.