Java Full Stack Interview Questions for Freshers (2026): 60+ Questions with Answers

What are the most asked Java full stack interview questions for freshers? Interviewers usually test six layers: Core Java and collections, SQL and JPA/Hibernate, Spring Boot and REST APIs, HTML/CSS/JavaScript (often with React), tools like Git and Maven, and finally your project, where they check whether you understand how the whole application works from the browser to the database. If you can explain that full flow clearly and answer the questions below with small examples, you’re well prepared.
This guide from VibrantMinds Technologies in Pune covers 60+ Java full stack developer interview questions and answers organised layer by layer, with code, a request-flow diagram, project-round questions, scenario questions, mistakes to avoid and a 30-day preparation plan. If you’ve been searching for Java full stack interview questions, Java full stack developer interview questions and answers, Java full stack interview questions for freshers, Spring Boot and React interview questions, SQL and Hibernate interview questions, REST API interview questions, Java full stack project interview questions or free IT job WhatsApp groups for freshers in Pune, this is built to be the complete answer.
KEY TAKEAWAYS (READ THIS FIRST)
Takeaway | Detail |
|---|---|
Know the whole flow | Be able to explain what happens from a button click in the browser to a row in the database and back. |
Fundamentals come first | OOP, collections, exceptions and SQL appear in almost every round. |
Spring Boot and REST are central | Expect questions on annotations, layers, status codes and exception handling. |
Front-end basics matter | Know HTML, CSS and JavaScript fundamentals, plus the basics of a framework such as React if it’s on your resume. |
Your project is the interview | Many follow-up questions come from the project you list. Only list what you can explain. |
Show code, not just definitions | Short examples make answers memorable. |
Be honest | Say “I haven’t used that yet, but I understand the concept” instead of bluffing. |
HOW A JAVA FULL STACK INTERVIEW USUALLY FLOWS
THE BIG PICTURE: REQUEST FLOW FROM BROWSER TO DATABASE
This is the single most useful thing to be able to draw and explain.
Say this in an interview: “A request goes from the browser to the controller, which calls the service layer for business logic, which uses a repository to talk to the database. The result is converted to JSON, sent back with an HTTP status code, and the front end updates the UI.”
LAYER 1: CORE JAVA (Q1 TO Q10)
Q1. What is the difference between JDK, JRE and JVM?
The JVM runs Java bytecode. The JRE is the JVM plus the standard libraries needed to run programs. The JDK includes the JRE plus development tools such as the compiler (javac). Developers need the JDK.
Q2. Explain the four pillars of OOP with a one-line example each.
Encapsulation: private fields with getters and setters. Inheritance: Dog extends Animal. Polymorphism: one method behaving differently (overloading at compile time, overriding at runtime). Abstraction: hiding details using abstract classes and interfaces.
Q3. Method overloading vs overriding?
Overloading means the same method name with different parameters in the same class (compile-time). Overriding means a subclass provides its own version of a parent method with the same signature (runtime).
Q4. Abstract class vs interface?
An abstract class can have state, constructors and both abstract and concrete methods, and a class can extend only one. An interface defines a contract, a class can implement many, and modern interfaces can have default and static methods.
Q5. Why is String immutable?
Immutability gives security, thread safety, safe use as map keys and enables the String pool to reuse objects. Use StringBuilder for frequent modifications.
Q6. == vs equals()?== compares references for objects. equals() compares logical content, if overridden (as in String).
Q7. What is the equals() and hashCode() contract?
If two objects are equal by equals(), they must have the same hashCode(). Override both together so hash-based collections like HashMap and HashSet work correctly.
Q8. Checked vs unchecked exceptions?
Checked exceptions (such as IOException) must be handled or declared. Unchecked exceptions (subclasses of RuntimeException, such as NullPointerException) don’t have to be.
Q9. What is try-with-resources?
A try block that automatically closes resources implementing AutoCloseable, avoiding manual finally cleanup.
java
Q10. final, finally and finalize?final is a modifier (constant, non-overridable method, non-inheritable class). finally is a block that runs after try and catch. finalize was an old method called before garbage collection and is deprecated, so avoid it.
LAYER 2: COLLECTIONS AND JAVA 8 (Q11 TO Q18)
Q11. ArrayList vs LinkedList?ArrayList is backed by a resizable array and gives fast random access. LinkedList is a doubly linked list with fast insertion and removal at known positions but slow index access. ArrayList is the usual default.
Q12. How does HashMap work internally?
It stores entries in an array of buckets. The key’s hashCode() decides the bucket, and equals() resolves collisions within it. In Java 8 and later, heavily collided buckets can convert from linked lists to balanced trees for better performance.
Q13. HashMap vs Hashtable vs ConcurrentHashMap?HashMap isn’t synchronised and allows one null key. Hashtable is an older synchronised class. ConcurrentHashMap is designed for safe, high-performance concurrent access.
Q14. Comparable vs Comparator?Comparable defines a class’s natural order inside the class (compareTo). Comparator defines external or custom orders (compare) and lets you sort the same class in many ways.
Q15. What is a lambda expression and a functional interface?
A lambda is a short way to implement a functional interface (an interface with one abstract method), such as Runnable or Comparator.
Q16. Explain the Stream API with an example.
java
Streams process data declaratively through intermediate operations (filter, map) and a terminal operation (collect).
Q17. What is Optional?
A container that may or may not hold a value, used to avoid null checks and NullPointerException: Optional.ofNullable(x).orElse("default").
Q18. What are record, var and text blocks (modern Java)?record creates a compact immutable data class. var infers local variable types. Text blocks (""") make multi-line strings. Mention that you’re aware of them and which Java version you use.
LAYER 3: SQL AND HIBERNATE/JPA (Q19 TO Q30)
Q19. Types of SQL joins?
Join | Returns |
|---|---|
| Rows with matches in both tables |
| All rows from the left table plus matches from the right |
| All rows from the right table plus matches from the left |
| All rows from both tables where supported |
Q20. WHERE vs HAVING?WHERE filters rows before grouping. HAVING filters groups after GROUP BY.
sql
Q21. DELETE vs TRUNCATE vs DROP?DELETE removes selected rows and can be rolled back in a transaction. TRUNCATE removes all rows quickly. DROP removes the table itself. Exact behaviour can vary by database.
Q22. Primary key vs foreign key?
A primary key uniquely identifies a row. A foreign key links to a primary key in another table to maintain relationships.
Q23. Write a query to find the second highest salary.
sql
Q24. What is an index and when would you use one?
An index speeds up lookups on a column, at the cost of extra storage and slower writes. Add indexes to columns used often in WHERE and JOIN.
Q25. What is normalisation?
Organising data to reduce redundancy and improve integrity, using forms such as 1NF, 2NF and 3NF.
Q26. What are ACID properties?
Atomicity, Consistency, Isolation, Durability, the guarantees of reliable transactions.
Q27. What is JPA, and how is it different from Hibernate?
JPA is a specification for object-relational mapping in Java. Hibernate is a popular implementation of that specification.
Q28. Common JPA annotations?
java
Q29. Lazy vs eager loading? What is the N+1 problem?
Lazy loading fetches related data only when accessed. Eager loading fetches it immediately. The N+1 problem occurs when one query loads N parent rows and then N extra queries load each parent’s children. Fix it with join fetch or entity graphs.
Q30. What does @Transactional do?
It runs the annotated method within a transaction, so that all database operations succeed together or are rolled back on failure (for runtime exceptions by default).
LAYER 4: SPRING BOOT AND REST APIs (Q31 TO Q42)
Q31. What is Spring Boot and why is it used?
Spring Boot simplifies building Spring applications with auto-configuration, starter dependencies, an embedded server and production-ready features, so you can create a runnable app with minimal setup.
Q32. What are dependency injection and IoC?
Inversion of Control means the framework creates and manages objects instead of your code doing it. Dependency injection is how those dependencies are supplied to a class, ideally through the constructor.
java
Q33. @Component, @Service, @Repository, @Controller?
All register Spring beans. They also describe roles: @Service for business logic, @Repository for data access (with exception translation), @Controller and @RestController for web layer.
Q34. @Controller vs @RestController?@RestController = @Controller + @ResponseBody, so return values are written directly to the response (usually JSON).
Q35. A simple REST controller
java
Q36. @PathVariable vs @RequestParam vs @RequestBody?@PathVariable reads from the URL path (/students/5). @RequestParam reads query parameters (?course=Java). @RequestBody reads the JSON body into an object.
Q37. HTTP methods and idempotency?
Method | Typical use | Idempotent? |
|---|---|---|
GET | Read | Yes |
POST | Create | No |
PUT | Replace or update | Yes |
PATCH | Partial update | Not guaranteed |
DELETE | Remove | Yes |
Q38. Common HTTP status codes to know200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 500 Internal Server Error.
Q39. How do you handle exceptions globally?
java
Q40. How do you validate input?
Use Bean Validation annotations (@NotBlank, @Email, @Min) on DTO fields and @Valid on the controller parameter.
Q41. What is an Entity vs a DTO, and why use DTOs?
An entity maps to a database table. A DTO (Data Transfer Object) shapes the data sent to or from the API. DTOs avoid exposing internal fields, prevent over-posting and decouple the API from the database design.
Q42. What are Spring profiles and application.properties?application.properties (or .yml) holds configuration such as the database URL and port. Profiles let you use different configuration for development, testing and production.
LAYER 5: HTML, CSS AND JAVASCRIPT (Q43 TO Q52)
Q43. What are semantic HTML tags and why do they matter?
Tags such as <header>, <nav>, <main>, <section>, <article> and <footer> describe meaning, improving accessibility, readability and SEO.
Q44. Explain the CSS box model.
Every element is a box made of content, padding, border and margin.
Q45. Flexbox vs Grid?
Flexbox arranges items in one dimension (row or column). Grid handles two dimensions (rows and columns) at once.
Q46. What is responsive design?
Layouts that adapt to different screen sizes using flexible units, flexbox or grid and media queries.
Q47. var, let and const?var is function-scoped and hoisted. let and const are block-scoped. const can’t be reassigned (but an object it references can still be modified).
Q48. == vs === in JavaScript?== compares values after type conversion. === compares value and type, so prefer ===.
Q49. What is a closure?
A function that remembers variables from its outer scope even after the outer function has finished.
javascript
Q50. What are promises and async/await?
A promise represents a future result. async/await lets you write asynchronous code that reads like synchronous code.
javascript
Q51. map, filter and reduce?map transforms each item. filter keeps items that match a condition. reduce combines items into one value.
Q52. localStorage vs sessionStorage vs cookies?localStorage persists until cleared. sessionStorage lasts for the tab session. Cookies are sent with HTTP requests and can have expiry and security flags. Avoid storing sensitive data in browser storage without careful design.
LAYER 6: REACT BASICS (Q53 TO Q58)
Check your target job description. Some roles use React, others use Angular or plain JavaScript. Mention only what you’ve actually learned.
Q53. What is React and what is the virtual DOM?
React is a library for building user interfaces from components. The virtual DOM is an in-memory representation React compares with the previous version to update only what changed in the real DOM.
Q54. Props vs state?
Props are inputs passed from parent to child and are read-only. State is data managed inside a component that triggers a re-render when it changes.
Q55. What are hooks? Explain useState and useEffect.
jsx
Q56. Why do list items need a key?
Keys help React identify which items changed, were added or removed, so it updates lists efficiently and correctly.
Q57. What is a controlled component?
A form element whose value is controlled by React state through value and onChange.
Q58. How does React talk to a Spring Boot backend?
Using fetch or a library like Axios to call the REST endpoints, sending and receiving JSON. During development, the backend must allow the front end’s origin (see CORS in the security section).
LAYER 7: GIT, MAVEN, POSTMAN AND DOCKER BASICS (Q59 TO Q62)
Q59. Common Git commands and workflow?git clone, git status, git add, git commit, git push, git pull, git branch, git checkout or git switch, git merge. A typical flow: create a branch, commit changes, push, raise a pull request, review and merge.
Q60. What is Maven and what does pom.xml do?
Maven is a build and dependency-management tool. pom.xml lists dependencies, plugins and project settings. Common lifecycle steps: clean, compile, test, package.
Q61. What is Postman used for?
Testing REST APIs by sending requests (GET, POST and others) with headers and bodies and inspecting responses.
Q62. Docker image vs container?
An image is a packaged, read-only template with an application and its dependencies. A container is a running instance of an image. Mention Docker only if you’ve actually used it.
LAYER 8: SECURITY BASICS (Q63 TO Q66)
Q63. What is CORS and why do you see CORS errors?
Browsers enforce the same-origin policy. When a front end on one origin calls an API on another, the server must explicitly allow that origin using CORS configuration, or the browser blocks the response.
Q64. What is JWT and how is it used for authentication?
A JSON Web Token is a signed token (header, payload, signature) the server issues after login. The client sends it with later requests, and the server verifies it without keeping session state. The payload is encoded, not encrypted, so don’t put secrets in it.
Q65. How should passwords be stored?
Never store plain-text passwords. Store a salted hash using a strong algorithm such as BCrypt.
Q66. What is SQL injection and how do you prevent it?
An attack where malicious input alters a SQL query. Prevent it with parameterised queries or prepared statements, JPA or ORM parameter binding and input validation.
java
THE PROJECT ROUND: HOW TO EXPLAIN YOUR FULL STACK PROJECT
Use this framework for a clear 3-minute explanation.
Project questions interviewers commonly ask
Question | What a good answer includes |
|---|---|
“Walk me through your project architecture.” | The layered flow with one example request |
“Why did you choose this database?” | A genuine reason and what you stored |
“How did you design your tables and relationships?” | Entities, keys, one-to-many example |
“How do you handle validation and errors?” | DTO validation, global exception handler, status codes |
“How is authentication handled?” | Login flow, password hashing, token or session approach |
“What was the hardest bug you fixed?” | The symptom, how you debugged it and the fix |
“How did you test it?” | Unit tests, Postman, manual test cases |
“What would you improve?” | Pagination, caching, better tests, security hardening |
“How would you deploy it?” | Build with Maven, run the jar, environment configuration, optionally Docker |
Honesty rule: list only what you can explain line by line. If you used tutorials or AI help, make sure you understand every part and can modify it.
SCENARIO QUESTIONS
Scenario | A solid approach |
|---|---|
“Your API is slow. What would you check?” | Query performance and indexes, N+1 queries, response size, pagination, logs and profiling |
“The front end shows a CORS error.” | Check the allowed origins in the backend, the request method and headers, and whether the server returns CORS headers |
“A user submits an invalid form.” | Validate on the front end and back end, return |
“How would you add pagination?” | Use |
“A record can’t be found.” | Return |
“Two users update the same record.” | Mention optimistic locking with a version field, at a conceptual level |
“Production shows a | Read the stack trace, find the line, reproduce, fix and add a test |
MISTAKES FRESHERS MAKE IN JAVA FULL STACK INTERVIEWS
Mistake | Why it hurts | Better approach |
|---|---|---|
Listing many technologies without depth | Follow-up questions expose gaps | List fewer skills you can explain well |
Not knowing the request flow | Shows shallow project understanding | Practise drawing it |
Weak SQL | SQL appears everywhere | Practise joins, group by and subqueries |
Confusing JPA and Hibernate | A basic concept gap | Learn: spec vs implementation |
Ignoring status codes and error handling | Looks like toy-level code | Use proper codes and a global handler |
Copying a project from a tutorial | You can’t answer “why” | Build your own variation and explain choices |
Memorising answers | Breaks with follow-ups | Understand concepts and use examples |
Not asking for clarification | Misunderstood questions | Repeat or clarify the question briefly |
Bluffing | Loses trust | Say what you know and what you’re learning |
30-DAY PREPARATION PLAN
Week | Focus | Tasks |
|---|---|---|
Week 1 | Core Java and collections | Revise OOP, strings, exceptions, collections, Java 8. Solve 2 coding problems daily. |
Week 2 | SQL, JPA and Spring Boot | Practise 30 SQL queries. Build a CRUD REST API with validation and exception handling. |
Week 3 | Front end and integration | Revise HTML, CSS, JavaScript and React basics. Connect a front end to your API. |
Week 4 | Project, tools and mock interviews | Prepare a 3-minute project explanation. Revise Git and Maven. Do 3 mock interviews and fix weak topics. |
Daily routine: 1 hour of concepts, 1 hour of coding or building, 30 minutes of mock questions aloud.
MYTH VS REALITY
Myth | Reality |
|---|---|
“Full stack means knowing everything.” | Interviewers expect solid basics across layers, not expert depth in all. |
“Only Spring Boot matters.” | Core Java, SQL and the project round matter just as much. |
“Front-end questions are optional.” | For full stack roles, basic HTML, CSS and JavaScript are usually expected. |
“A big project list impresses.” | One well-explained project impresses more than five you can’t explain. |
“Freshers can’t be asked system flow questions.” | The request-flow question is very common. |
“Certificates alone get you hired.” | Skills, projects and clear communication matter most. |
HOW VIBRANTMINDS HELPS FRESHERS PREPARE FOR JAVA FULL STACK INTERVIEWS
VibrantMinds Technologies Pvt. Ltd. is a Pune-based IT training and placement support company. If you searched for VibrantMinds or VibrantMinds Technologies, here is what it offers:
Full Stack Java Development (about 4 to 6 months): Core Java, OOP, JDBC, SQL, Spring Boot, REST APIs, front-end basics, projects, aptitude and interview preparation. Please check the candidate portal for the latest syllabus and tools covered.
Core Java (about 1 to 2 months), Software Testing (Manual + Automation) and Python & Data Science for other paths
Project practice: Build a full stack project you can explain from browser to database
Interview preparation: Technical rounds, project rounds, HR rounds, aptitude, communication and mock interviews
Resume and LinkedIn guidance: Clear, honest profiles
Placement support: Screening, drive coordination and interview support. Check the campus-drives portal at https://candidates.vibrantminds.in/ for current openings.
Free WhatsApp job alert groups for fresher IT jobs and drives
Honesty first: VibrantMinds offers placement support, not a guaranteed job, and no legitimate recruiter should ask you to pay to be interviewed.
VibrantMinds works as a talent ecosystem connecting candidates, colleges and companies, with 1900+ partner colleges and 600+ hiring companies. Read more fresher job guidance here: https://candidates.vibrantminds.in/blog/fresher-jobs-pune-2026
VIBRANTMINDS COURSES AT A GLANCE
Course | Duration | Key topics |
|---|---|---|
Full Stack Java Development | 4 to 6 months | Core Java, OOP, JDBC, SQL, Spring Boot, REST APIs, front-end basics, projects, aptitude and interview preparation |
Software Testing (Manual + Automation) | 2 to 5 months | Test cases, STLC, bug tracking, SQL, Selenium basics |
Core Java | 1 to 2 months | Syntax, OOP, collections, exceptions, strings |
Python & Data Science | 2 to 4 months | Python basics, data handling, analysis fundamentals |
Fees, syllabus and batch dates are on https://candidates.vibrantminds.in/. Please confirm them directly before enrolling.
THE VIBRANTMINDS PLACEMENT PIPELINE: SIX STEPS
REAL OUTCOMES: WHAT TO EXPECT AND WHAT NOT TO
Past students have shared positive feedback about the training and support, and have gone on to roles at companies such as Aress Software and Education Technologies, Saama Technologies and Three M Software. Results vary by candidate, skill level, effort and market conditions, so please confirm details directly with the VibrantMinds team. No one can honestly promise a guaranteed job.
JOIN FREE VIBRANTMINDS WHATSAPP GROUPS: FRESHER IT JOB UPDATES FOR PUNE AND INDIA
Looking for free WhatsApp groups for IT jobs, a Java WhatsApp group for freshers or a job updates WhatsApp group in India? The VibrantMinds groups share fresher IT openings, campus drives, walk-in interview alerts and interview preparation updates, free of charge. Join whichever group has space. All three carry the same type of updates.
Group | What it offers | Link |
|---|---|---|
VibrantMinds Fresher IT Jobs, Group 1 | Fresher openings, campus drives, walk-in alerts | |
VibrantMinds Fresher IT Jobs, Group 2 | Fresher openings, campus drives, walk-in alerts | |
VibrantMinds Fresher IT Jobs, Group 3 | Fresher openings, campus drives, walk-in alerts |
Never pay to apply. Legitimate recruiters do not charge candidates for tests, interviews or offer letters. Do not share sensitive personal or financial details in any group chat.
FREQUENTLY ASKED QUESTIONS
1. What are the most asked Java full stack interview questions for freshers?
Core Java and OOP, collections and Java 8, SQL joins and JPA/Hibernate, Spring Boot and REST APIs (annotations, layers, status codes), HTML, CSS and JavaScript fundamentals, React basics if listed, Git and Maven, and detailed questions about your project and how the request flows from browser to database.
2. How do I explain a Java full stack project in an interview?
Use a six-part structure: the problem, tech stack, architecture and request flow, your own role, one real challenge you solved and what you’d improve. Practise a 3-minute version and be ready to open the code and explain any part.
3. What Java full stack developer interview questions are asked for 0 to 1 year experience?
Mostly fundamentals: OOP, collections, exceptions, SQL queries, Spring Boot REST basics, JavaScript basics and your project. Experienced-level topics such as microservices and system design may be asked lightly, mainly to check awareness.
4. How does a request flow from React to Spring Boot to the database?
The React component calls the API with fetch or Axios. The Spring Boot controller receives the request, calls the service layer for business logic, the repository queries the database through JPA or Hibernate, and the result returns as JSON with an HTTP status code that React uses to update the UI.
5. Are there free WhatsApp groups for IT fresher jobs in Pune?
Yes. VibrantMinds runs free fresher IT job WhatsApp groups that share openings, campus drives and walk-in alerts. Join through the links above. Always verify any job post and never pay to apply.
CONCLUSION: PREPARE LAYER BY LAYER, AND KNOW YOUR PROJECT
Strong Java full stack interview questions preparation means mastering fundamentals in each layer, being able to draw and explain the request flow, practising SQL and Spring Boot with real code, knowing the basics of JavaScript and React, and presenting one project you truly understand. Use the 30-day plan, practise aloud, and stay honest about what you know.
If you’re in Pune and want structured Java full stack training with project practice, interview preparation and placement support, VibrantMinds Technologies is here to help.
Call to action:
Website: https://vibrantminds.in/
Candidate portal and courses: https://candidates.vibrantminds.in/
Fresher jobs guide: https://candidates.vibrantminds.in/blog/fresher-jobs-pune-2026
Join the free WhatsApp groups: the three links above
VISIT OR CONTACT VIBRANTMINDS IN PUNE
Company: VibrantMinds Technologies Pvt. Ltd.
Address: Viva Academy Building, Warje, Pune, Maharashtra 411052
Phone: +91 95035 79517
Email: support@vibrantmindstech.com
Website: https://vibrantminds.in/
Candidate portal and courses: https://candidates.vibrantminds.in/


