Java — Interview questions
Backend Design
Resilience patterns, caching strategy, rate limiting, idempotency, circuit breakers, graceful shutdown, and choosing between REST, gRPC and messaging.
8 questions
Build Tools
Maven vs Gradle, the Maven lifecycle, dependency scopes, and structuring a multi-module project.
4 questions
Collections
The Collections framework — List/Set/Map types, ArrayList vs LinkedList, comparators, and copies.
14 questions
Collections in Depth
Iterators, immutable collections, deques and queues, ConcurrentModificationException, PriorityQueue, NavigableSet, sequenced collections, and LinkedHashMap.
8 questions
Concurrency
Threads, synchronization, deadlock, volatile, and the wait/notify coordination primitives.
13 questions
java.util.concurrent
Explicit locks and reentrancy, Condition objects, CAS and atomics, synchronizers, and concurrent collections including ConcurrentHashMap.
9 questions
Core Language
Java features, the main method, primitives vs wrappers, static vs instance, and final/finally/finalize.
9 questions
Design Patterns
Common design patterns in Java — singleton, factory, builder, and dependency injection.
11 questions
Equality & Hashing
The equals/hashCode contract, == vs equals(), and common equality and hashing pitfalls.
3 questions
Exceptions
Checked vs unchecked exceptions, throw vs throws, catch ordering and multi-catch, exception chaining, try-with-resources and suppressed exceptions.
15 questions
Executors & Thread Pools
The Executor framework, Runnable vs Callable, thread-pool sizing, rejection policies, CompletableFuture, and ForkJoinPool.
8 questions
Garbage Collection
Generational collection, System.gc(), low-latency collectors, reference types, memory leaks despite a GC, and GC tuning and diagnosis.
10 questions
Generics
Raw types, generic methods, type erasure, bounded type parameters, wildcards, PECS, and heap pollution.
9 questions
JVM & Memory
JVM/JRE/JDK, platform independence, bytecode execution, memory areas, and garbage collection.
9 questions
Functional Java
Lambdas, functional interfaces, method references, generics basics, and Optional.
7 questions
Modern Language Features
Records, sealed types, pattern matching for instanceof and switch, record patterns, text blocks, and type inference.
7 questions
OOP
Abstract classes vs interfaces, overloading vs overriding, inner classes, and the diamond problem.
12 questions
JVM Performance
JIT compilation, reading bytecode, virtual vs static dispatch, escape analysis, AOT class caching, and profiling a running JVM.
9 questions
Persistence
Database access from Java — JDBC, statements, and parameterized queries.
6 questions
Primitives & Wrappers
Primitive types and their wrappers, autoboxing, the Integer cache, arrays, and why Java is not purely object-oriented.
5 questions
Serialization & Reflection
Serialization and deserialization, the transient keyword, and the Reflection API.
4 questions
Spring
The Spring framework — the IoC container, dependency injection, and bean scopes and lifecycle.
6 questions
Spring Boot
Auto-configuration and conditional beans, Actuator, Spring MVC vs WebFlux, the Spring Security filter chain, and centralised REST exception handling.
9 questions
Stream API
Stream pipelines — intermediate and terminal operations, laziness, map vs flatMap, collectors, reduce vs collect, parallel streams, and gatherers.
12 questions
Strings
The string constant pool, string immutability, StringBuilder vs StringBuffer, and immutable classes.
5 questions
Testing
JUnit 5, Arrange-Act-Assert, the TDD cycle, Mockito test doubles, flaky tests, mutation testing, contract testing, and integration tests.
8 questions
Virtual Threads (Loom)
Virtual vs platform threads, carrier threads and pinning, Scoped Values as a final ThreadLocal replacement, and Structured Concurrency while it is still a preview API.
7 questions