Java remains one of the most in-demand skills for backend roles, which means Java interviews are competitive and thorough. Interviewers do not just want definitions. They want to see that you understand how Java behaves, can explain your choices, and have actually built something with it.

Most Java interviews test four things: core language knowledge, object-oriented design, frameworks such as Spring Boot, and the projects on your resume. Here are the core questions that come up again and again.

Core Java questions

1. What is the difference between an abstract class and an interface? A strong answer covers when you would choose each: interfaces define a contract that unrelated classes can share, while abstract classes share state and partial implementation among related classes. Mention default methods in interfaces to show you know modern Java.

2. How does HashMap work internally? Explain hashing, buckets, how collisions are handled, and what happens when the map grows. Interviewers like candidates who also mention why equals() and hashCode() must be consistent.

3. What is the difference between == and equals()? One compares references, the other compares logical equality. Add an example with String to show you understand the string pool.

4. Explain how garbage collection works. You do not need every collector. Show that you know objects become eligible when they are unreachable, and that you understand why memory leaks can still happen.

5. How do you handle exceptions, and what is the difference between checked and unchecked exceptions? Give a real example of how you handled errors in a project, not just the definition.

6. What are the main features of Java 8 and later? Talk about lambdas, streams, Optional and records, and when you have used them.

Practise these questions the way a real panel asks them

Reading questions and answers is a good start, but it is not the same as answering out loud under pressure. Careerscan is built for that gap.

Careerscan reads your resume against the Java role you want, then interviews you on it. A Java specialist interviewer asks about the skills in the job and the projects on your resume, such as “Your resume says you built a REST API in Spring Boot. How did you handle validation and errors?” It asks follow-up questions when an answer is thin, just as a real interviewer would.

  • Questions come from your own resume, the job’s skills and what that company is reported to ask
  • Answer by voice or text, one question at a time
  • Every answer is scored on 8 clear criteria, quoting your own words and showing what a stronger answer would include
  • Each weak spot becomes a short lesson and practice round

Want to see how you really perform? Start free on Careerscan (15 free credits, enough for a full interview with its report, no card needed)

Spring Boot and project questions

7. What is dependency injection, and why does Spring use it? Explain that objects receive their dependencies instead of creating them, which makes code easier to test and change. Mention constructor injection as the preferred style.

8. How do you build and secure a REST API in Spring Boot? Walk through controllers, services and repositories, request validation, error handling and authentication. Speak from your own project.

9. How do you handle validation and errors in your API? Mention input validation, a global exception handler and meaningful status codes.

10. Tell me about a performance or design problem you solved. This is where many candidates lose points. Describe the problem, what you did yourself, and the measurable result.

How to answer well

  1. Lead with the point, then explain.
  2. Use your own project as the example whenever you can.
  3. Say “I” for what you did, not only “we”.
  4. Add a result, such as faster response times or fewer errors.
  5. Say so honestly when you do not know something, and explain how you would find out.

The bottom line

Java interviews reward candidates who understand the why behind the code and can talk about real work. Learn the concepts, then practise saying them out loud on questions drawn from your own resume.

Do not wait for the real interview to find your weak spots. Start your free Careerscan interview and walk in already practised.