Backend 路 Intern to senior

Java Interview Questions and Answers

Java interviews are famous for going deep on the collections framework, the JVM and concurrency. Freshers are asked about OOP and core classes; mid-level candidates are asked how HashMap and the garbage collector work internally; senior candidates are asked to reason about thread safety, memory visibility and deadlocks.

Download Java PDF12 questions

4 of 12 questions match

Clear filters
  • JavaMedium

    How does HashMap work internally in Java?

    A HashMap stores entries in an array of buckets; it computes the key's hash code to choose a bucket, resolves collisions with a linked list that becomes a red-black tree when a bucket grows large, and resizes when the load factor of 0.75 is exceeded.

    Mid-level 路 Senior 路 Data Structures
  • JavaHard

    How does JVM memory management and garbage collection work in Java?

    The JVM divides memory into a per-thread stack, a shared heap (split into young and old generations) and Metaspace; the garbage collector frees heap objects that are no longer reachable, collecting short-lived young objects frequently and old objects less often.

    Mid-level 路 Senior 路 Memory Management