Skip to content
Languagesintermediate · 60 min

Java

Statically typed, object-oriented, runs on the JVM. Know the collections framework, JVM memory and garbage collection, concurrency primitives, and generics with type erasure.

Collections & generics

The Collections Framework (List, Set, Map and implementations like ArrayList, HashMap, TreeMap) is interview bread-and-butter — know their complexities. Generics give compile-time type safety but are erased at runtime (type erasure), which limits some reflection/array operations.

JVM memory & GC

Objects live on the heap (divided into generations); local variables and references live on the stack. The garbage collector reclaims unreachable objects automatically; understanding young/old generations and stop-the-world pauses helps reason about performance.

Concurrency

Java has real threads. `synchronized`, `volatile`, and the `java.util.concurrent` package (ExecutorService, ConcurrentHashMap, locks, atomics) manage shared state. The key risks are race conditions, deadlock, and visibility bugs without proper synchronization.

Resources

Practice & test yourself

Take the quiz →