Java interviews fail when they test trivia the IDE remembers for everyone. These questions instead probe the JVM, concurrency judgment, and Spring depth that decide how a candidate performs in the large, long-lived systems where Java actually lives β with notes on what strong answers cover.
What a strong answer covers
Young and old generations, minor versus full collections, and modern collectors (G1 default, ZGC for low pause). Tuning stories should start from evidence β GC logs, allocation profiling β not cargo-culted flags. Knowing when the answer is 'fix the allocation, not the collector' is the senior tell.
What a strong answer covers
Equal objects must share hash codes; violations silently break HashMap and HashSet lookups β elements vanish or duplicate. Records and IDE generation as the modern practice, plus the mutable-key-in-a-map trap as the war story worth telling.
What a strong answer covers
ArrayList and HashMap as workhorses with growth and load-factor awareness, ConcurrentHashMap for shared maps, EnumMap/EnumSet niceties. The honest answer on LinkedList is 'almost never' given cache behavior β that honesty is the point of the phrasing.
What a strong answer covers
volatile for visibility without atomicity, synchronized/locks for mutual exclusion, and a strong preference for higher-level tools: concurrent collections, ExecutorService, CompletableFuture, atomics. Happens-before reasoning at a working level separates real concurrency experience from keyword recall.
What a strong answer covers
Lightweight JVM-scheduled threads making thread-per-request viable at high concurrency without async gymnastics; pinning pitfalls with synchronized blocks around blocking calls; where reactive stacks still make sense. This question also dates a candidate's currency with modern Java releases.
What a strong answer covers
GC pauses as the first suspect via GC logs, then thread dumps for lock contention or pool exhaustion, JFR or async-profiler for flame graphs, connection-pool and downstream-dependency checks. A tool-named, ordered method is the pass; guessing is the fail.
What a strong answer covers
Constructor injection as the default, singleton scope assumptions, circular-dependency resolution and why its appearance signals design smell, and proxy-based behavior underlying much of Spring. Real anecdotes about @Transactional or lazy-init surprises are worth extra credit.
What a strong answer covers
Proxy-based interception: self-invocation bypasses the proxy, private methods are not intercepted, checked exceptions do not roll back by default, and propagation settings change semantics. This is among the highest-yield Spring questions because the failures are silent in production.
What a strong answer covers
Deliberate starter selection, excluding autoconfiguration not in use, profiling startup, container-aware JVM sizing, and native-image or CDS awareness as options. Treating the framework as a set of choices rather than an inevitability is the mindset being screened.
What a strong answer covers
Clear wins in transformation pipelines and readability; abuse in deeply nested streams, side effects inside map, parallel streams applied without measurement or with shared mutable state. Preferring a plain loop when clearer signals maturity rather than weakness.
What a strong answer covers
Concrete usage: records for data carriers, sealed interfaces with exhaustive switch for domain modeling, pattern matching reducing casting ceremony. A candidate still writing Java 8 idioms on a modern JDK is leaving safety and clarity on the table β this question surfaces that quickly.
What a strong answer covers
JUnit 5 with Mockito used judiciously, Spring slice tests versus full-context costs, Testcontainers for real databases and brokers over in-memory approximations, and contract tests where services integrate. Fast-suite discipline β keeping the full build tolerable β is the operational marker.
What a strong answer covers
Characterization tests around critical paths, JDK upgrade path with dependency audit, observability before refactoring, and incremental extraction only where the business case exists. Respect for working legacy code, plus a plan to make it changeable, is exactly what enterprise Java work demands.
Skip the interviews entirely β get matched with pre-vetted Java developers in 48 hours, $0 until you hire.
Need a custom question set?
Our free interview question generator builds a tailored list for any role, seniority, and focus area.
Try the interview question generator βThe JVM, collections, and Spring questions are durable. The virtual-threads and modern-features questions are deliberate currency checks β refresh them against the latest LTS every year or two, and treat a candidate's answer as evidence of whether they track the platform at all.
Mostly yes β JVM, concurrency, Spring, and testing questions transfer directly. Swap the language-feature questions for their Kotlin equivalents and confirm reading fluency in Java if your codebase is Java-first.
A code review of a small Spring service with planted defects: a self-invoked @Transactional method, a mutable HashMap key, an unbounded thread pool. It tests the exact silent-failure knowledge these questions target, in under an hour.
Hire directly
Hire vetted Java developers in the USA βOther interview guides
Vetted talent ready for US teams. No recruitment fees. Zero risk.
πΊπΈ Trusted by companies across the United States