Java interviews at the senior level go far beyond syntax. Interviewers expect you to reason about JVM internals, garbage collection trade-offs, the Java Memory Model, and how the collections framework actually works under the hood. Surface-level answers about “HashMap uses hashing” won’t cut it.
These 60 questions cover the concepts that consistently appear in senior Java interviews at top companies: concurrency primitives, class loading, generics and type erasure, functional interfaces, and modern Java features from records to virtual threads. Each question is designed to test whether you can explain why, not just what.
The JVM, JRE, and JDK are nested components of the Java platform, each building on the previous.
Read full answer →Java's platform independence is summarized by the principle "Write Once, Run Anywhere" (WORA).
Read full answer →The JVM processes Java programs through four major subsystems: the class loader, the bytecode verifier, the execution engine, and the runtime memory areas.
Read full answer →Java is defined by a set of deliberate design choices that have kept it relevant for three decades.
Read full answer →The `public static void main(String[] args)` signature is Java's program entry point — the method the JVM calls to start execution.
Read full answer →The String Constant Pool (also called String Intern Pool) is a special memory region inside the JVM's heap where string literals are stored and reused.
Read full answer →String immutability in Java means that once a `String` object is created, its character sequence cannot be changed.
Read full answer →Both `StringBuffer` and `StringBuilder` are mutable character sequences used when you need to build or modify strings without creating multiple intermediate `String` objects.
Read full answer →The `equals()` method defines logical equality between objects — whether two instances should be considered the same value.
Read full answer →In Java, exceptions are divided into checked and unchecked.
Read full answer →Java has eight primitive types — `byte`, `short`, `int`, `long`, `float`, `double`, `char`, and `boolean` — that are not objects and cannot be used where `Object` references are required.
Read full answer →A pure object-oriented language treats everything as an object and only allows object-based operations.
Read full answer →Abstract classes and interfaces both enable abstraction, but they serve different design purposes.
Read full answer →A marker interface is an interface that declares no methods or fields.
Read full answer →The Java Collections Framework (JCF) is a unified architecture for representing and manipulating groups of objects.
Read full answer →Both `ArrayList` and `Vector` are `List` implementations backed by a resizable array, and they share the same core operations.
Read full answer →`finalize()` is a method defined on `java.lang.Object` that the garbage collector is permitted to call on an object before reclaiming its memory, giving the object a chance to release native resources or perform cleanup.
Read full answer →`Comparable` and `Comparator` are both interfaces used for ordering objects, but they serve different design purposes.
Read full answer →An inner class is a class defined within the body of another class or interface.
Read full answer →These three keywords sound similar but serve completely different purposes.
Read full answer →In Java, `==` and `equals()` test different things and the distinction is fundamental to writing correct code.
Read full answer →Method overloading and method overriding are both forms of polymorphism but operate at different phases and on different axes.
Read full answer →HashMap and Hashtable both implement the Map interface and store key-value pairs using a hash table, but they differ in synchronization, null handling, and historical context.
Read full answer →ArrayList and LinkedList are both implementations of the List interface in Java, but they are backed by fundamentally different data structures.
Read full answer →The Java Reflection API, in the `java.lang.reflect` package, enables a program to examine and modify its own structure and behavior at runtime.
Read full answer →The JVM divides memory into several runtime data areas, each with a specific purpose and lifecycle.
Read full answer →`throw` and `throws` are both part of Java's exception mechanism but operate at different points and serve different purposes.
Read full answer →The Singleton pattern ensures that a class has exactly one instance throughout the application's lifetime and provides a global point of access to it.
Read full answer →The Stream API, introduced in Java 8 in `java.util.stream`, enables functional-style processing of sequences of elements through declarative, composable pipelines.
Read full answer →The terms fail-fast and fail-safe describe how iterators behave when the underlying collection is modified during iteration.
Read full answer →A process and a thread are both units of execution, but they operate at different levels of the operating system and have fundamentally different resource isolation models.
Read full answer →Java provides several mechanisms to create and run threads, each with different tradeoffs.
Read full answer →Synchronization in Java is the mechanism by which the JVM controls access to shared resources by multiple threads, preventing data races and ensuring memory visibility.
Read full answer →A deadlock is a situation where two or more threads are permanently blocked, each waiting to acquire a lock held by another thread in the cycle.
Read full answer →The volatile keyword in Java is a field modifier that guarantees visibility and ordering guarantees for a variable across multiple threads.
Read full answer →The transient keyword in Java is a field modifier that instructs the serialization mechanism to skip a field when converting an object to a byte stream.
Read full answer →Serialization is the process of converting a Java object's state into a byte stream so it can be persisted to disk, stored in a database, or transmitted over a network.
Read full answer →A functional interface in Java is an interface that declares exactly one abstract method.
Read full answer →Lambda expressions, introduced in Java 8, are anonymous function literals that implement a functional interface inline without the boilerplate of an anonymous inner class.
Read full answer →Collection (singular, no 's') is the root interface in the Java Collections Framework hierarchy.
Read full answer →List and Set are both sub-interfaces of Collection but with fundamentally different contracts around ordering and uniqueness.
Read full answer →HashSet and TreeSet are both implementations of the Set interface in Java, but they differ fundamentally in their underlying data structures, performance characteristics, and ordering guarantees.
Read full answer →The diamond problem is a classic multiple inheritance ambiguity that arises when a class inherits from two parents that both provide a concrete implementation of the same method, and both parents share a common superclass or interface defining that method.
Read full answer →Dependency injection (DI) is a design pattern implementing the Inversion of Control (IoC) principle.
Read full answer →A shallow copy creates a new object and copies the top-level field values from the original.
Read full answer →Design patterns are proven, reusable solutions to commonly recurring software design problems.
Read full answer →The Factory pattern encapsulates object creation behind a method or class, so callers request objects by type or configuration without depending on concrete class names or constructors.
Read full answer →The Builder pattern separates the construction of a complex object from its representation, allowing the same construction process to produce different configurations.
Read full answer →In Java, memory is divided into two primary regions: the stack and the heap.
Read full answer →Garbage collection (GC) in Java is the automatic process of identifying objects on the heap that are no longer reachable from any GC root (active threads, static fields, local variables on stack) and reclaiming their memory.
Read full answer →Java provides several garbage collector implementations, each representing a different set of tradeoffs between throughput, latency, and resource usage.
Read full answer →wait() and sleep() both pause thread execution, but they serve entirely different purposes and behave very differently with respect to locks.
Read full answer →Both notify() and notifyAll() are Object methods that wake threads suspended in wait() on the same object's monitor.
Read full answer →An immutable class is a class whose instances cannot be modified after construction.
Read full answer →String, StringBuilder, and StringBuffer all represent character sequences in Java but differ critically in mutability and thread safety.
Read full answer →Static variables (also called class variables) are declared with the static keyword and belong to the class itself rather than any particular object.
Read full answer →The super keyword in Java is a reference to the parent (superclass) of the current class.
Read full answer →The this keyword in Java is an implicit reference to the current object — the instance on which the current method or constructor is executing.
Read full answer →Java generics, introduced in Java 5, allow classes, interfaces, and methods to be parameterized by type.
Read full answer →Type erasure is the mechanism by which the Java compiler removes all generic type parameters from the bytecode it produces.
Read full answer →Focus on understanding concepts deeply enough to explain them in your own words. For each topic, practice articulating the trade-offs and real-world applications — interviewers care about practical judgment, not textbook definitions.
Take a free AI-graded assessment across multiple domains. No signup required.
Start Free Assessment