What is asked in a Java interview, how to answer questions about JVM, collections, and multithreading, and how to rehearse the conversation.
A Java interview tests not knowledge of syntax — anyone who has written code knows it. It tests understanding of the platform: how memory works, why an application crashes under load, and what happens under the hood of the framework you use every day.
| Stage | What is assessed |
|---|---|
| Screening | experience, stack, salary expectations |
| Java theory | JVM, memory, collections, multithreading |
| Live coding | how you write and reason out loud |
| Architecture | Spring, DB, transactions, queues |
Classes are loaded via ClassLoader and undergo verification; bytecode is executed by the interpreter with JIT compilation of “hot” sections. The practical takeaway expected: JIT warms up the code, so the first seconds of operation are slower — hence the “warm-up” before a load test.
The heap is divided into generations: young (Eden + two Survivor spaces) and old. Objects that survive several collections move to the old generation. G1 collects regions and tries to keep pauses predictable. A common question is how to find a leak — the answer is via a heap dump and reference analysis.
ArrayList vs LinkedList (index access vs insertion), HashMap and what happens on a collision, why the key must be immutable, ConcurrentHashMap vs Hashtable. What is valued here is not the definition but choosing the right tool for the task.
synchronized vs Lock, volatile and its guarantees, happens-before, thread pools (ThreadPoolExecutor), CompletableFuture. Almost always they give a task: “two threads increment a counter — what will happen” and expect an analysis of the race condition.
Bean lifecycle, scopes, proxies and AOP, why `@Transactional` does not work when calling a method from the same class (self-invocation through a proxy). This question filters out many.
N+1 queries, lazy and eager loading, first- and second-level caches, transactions and isolation levels. They often ask you to find the problem in a piece of code with entities.
JUnit and Mockito, integration tests versus unit tests, Maven/Gradle, CI. They check whether you take code all the way to production.
The structure works: claim → justification → example → limitation. The last step is what distinguishes a practitioner.
“For this case, I would use ConcurrentHashMap. The reason is that reads come from multiple threads, while Hashtable locks the entire object. In a previous project, this removed a bottleneck in the metrics cache. Limitation: compound operations still need to be wrapped explicitly; per-key atomicity does not save you.”
— a sample answer from practical interview review
A week of 30–40 minutes if you have practical experience: work through the seven topics above, say the answers out loud, and go through one full dialogue once. If a topic (for example, multithreading) is unclear to you, cover it first.
Yes, but the proportions depend on the company. Product teams more often give practical tasks (debug a bug, optimize a query), large tech companies — classic tasks on arrays, strings, hash tables.
Say it directly and show your reasoning: what it is similar to, how you would check. An interviewer almost always distinguishes “I don’t know, but I’m thinking” from making things up, and the latter is a direct minus.
No, but you need to understand how proxies, transactions, and the bean lifecycle work. These are the questions asked most often, and you can’t answer them by memorizing annotations.
With a range, not a single number, based on the market. A detailed breakdown is in the article salary negotiations.
Describe the situation in one phrase — «Java developer interview, Spring Boot, five years of experience» — and go through the dialogue in simulator. The coach will ask questions about your role and review your answers after the conversation.
Go through the seven topics and mark where the answer doesn't add up. Then run the full dialogue: open HintMeTalk AI, “Coach” mode, describe the vacancy in one phrase. After the debrief, you can see which answers are weak — usually two or three out of ten.
Analyses for other roles: frontend, Python, . General preparation — in the article system analystinterview preparation.
Practise this skill in HintMeTalk AI
Open the app