Java Full Stack Internship Interview Questions for Freshers (with Answers)
By K. Boopathikumar, CEO & Founder · 16 November 2026 · 8 min read
Java full stack interviews for interns lean heavily on object-oriented basics and Spring Boot. Interviewers want to see that you understand why things work, not that you have memorised annotations.
Use these questions to check yourself. If an answer feels shaky, build a tiny example until it is clear.
Core Java and OOP
- What are the four pillars of OOP? Encapsulation (hide data behind methods), inheritance (reuse a parent class), polymorphism (one call, different behaviour) and abstraction (expose what, hide how).
- What is the difference between an abstract class and an interface? An abstract class can hold state and constructors and a class can extend only one. An interface defines a contract; a class can implement many, and since Java 8 interfaces can have default methods.
- Why is String immutable? So it can be shared safely across threads, cached in the string pool and used as a reliable HashMap key. Use StringBuilder when you build strings in a loop.
- What is the difference between == and equals()? == compares references (same object); equals() compares content when the class overrides it, as String does.
- Checked vs unchecked exceptions? Checked exceptions (IOException) must be caught or declared; unchecked ones (NullPointerException) extend RuntimeException and usually signal a programming error.
Collections
- ArrayList vs LinkedList? ArrayList gives fast index access and is the default choice. LinkedList is faster only for inserting or removing at known positions and uses more memory.
- How does a HashMap work? It hashes the key to find a bucket and stores entries there; collisions share a bucket. That is why keys must implement hashCode and equals consistently.
- HashSet vs TreeSet? HashSet has no order and is faster; TreeSet keeps elements sorted.
Spring Boot, JPA and the web
- What does Spring Boot add over Spring? Auto-configuration, starter dependencies and an embedded server, so a working REST API needs very little setup.
- What is dependency injection? Spring creates objects (beans) and passes them to the classes that need them, usually through the constructor. This keeps classes loosely coupled and easy to test.
- @Controller vs @RestController? @RestController returns data (JSON) directly; @Controller usually returns a view name for a template.
- What is JPA and Hibernate? JPA is the standard for mapping Java objects to tables; Hibernate is the most common implementation. A repository interface gives you save, find and delete without writing SQL.
- How do you handle validation and errors in a REST API? Use @Valid with constraint annotations such as @NotBlank, and a @ControllerAdvice class to turn exceptions into clear JSON errors with the right status code.
- Write a query for the second highest salary in an employee table. SELECT MAX(salary) FROM employee WHERE salary < (SELECT MAX(salary) FROM employee); then explain how you would handle ties.
How to answer well in the interview
- Draw the flow when asked about your project: browser, controller, service, repository, database.
- Know why you used each annotation in your own code, not just its name.
- Be ready to write a small class with a constructor, getters and an overridden toString or equals.
- Revise SQL joins and GROUP BY; almost every Java full stack interview includes one SQL question.
Next steps
- Study the free Java Full Stack learning path and take its module quizzes for a free certificate.
- Follow the Java Full Stack skill track from basic to advanced.
- Do real, reviewed work in a Java Full Stack internship and keep every project in your own GitHub.