Java Full Stack with React Interview Questions & Answers
All 200 unique questions in one place — 63 easy, 95 medium, 42 hard — grouped by topic.
Practise by topic
Practise the way your interview works
Why is String immutable in Java?
Show answer
What is the difference between == and equals() in Java?
Show answer
Compare String, StringBuilder and StringBuffer.
Show answer
What is the difference between checked and unchecked exceptions?
Show answer
Explain final, finally and finalize.
Show answer
What does the static keyword mean in Java?
Show answer
Show how to read a file safely using try-with-resources.
Show answer
Create a custom unchecked exception and throw it from a service method.
Show answer
Write a Java method to check whether a string is a palindrome, ignoring case and spaces.
Show answer
A report job builds a large string with + inside a loop and is very slow. What do you change?
Show answer
Why do you want to become a Java full stack developer?
Show answer
Describe the main JVM memory areas.
Show answer
How does garbage collection work in modern Java?
Show answer
Which features from Java 17 and Java 21 are useful for a full stack developer?
Show answer
Write code that runs tasks in parallel using ExecutorService and collects results.
Show answer
Write a record and use pattern matching in a switch expression.
Show answer
Your code has frequent NullPointerExceptions from repository lookups. How would you redesign it?
Show answer
You need a thread-safe singleton for a configuration loader. How do you implement it?
Show answer
Users in different countries see wrong order times. How do you handle dates and time zones in Java?
Show answer
Tell me about a difficult bug you fixed in a Java project.
Show answer
What is the difference between volatile and synchronized?
Show answer
Use CompletableFuture to call two services in parallel and combine the results.
Show answer
Your Spring Boot service crashes with OutOfMemoryError: Java heap space in production. How do you investigate?
Show answer
CPU is at 100 percent and requests are hanging. How would you find the cause in a Java application?
Show answer
What is the difference between List, Set and Map?
Show answer
When would you use ArrayList over LinkedList?
Show answer
What is the difference between Comparable and Comparator?
Show answer
What is a functional interface and how do lambdas relate to it?
Show answer
Find duplicate elements in a list of integers.
Show answer
You need to store unique usernames and always display them in alphabetical order. Which collection do you pick?
Show answer
How do you keep yourself updated with new Java versions and features?
Show answer
How does HashMap work internally?
Show answer
What is the contract between equals() and hashCode()?
Show answer
Compare HashMap, Hashtable and ConcurrentHashMap.
Show answer
What are fail-fast and fail-safe iterators?
Show answer
What are intermediate and terminal operations in Java Streams?
Show answer
Explain the difference between map and flatMap in streams.
Show answer
Using streams, group employees by department and count them.
Show answer
Find the second highest salary from a list of employees using streams.
Show answer
Sort a list of products by category, then by price descending, then by name.
Show answer
Count the frequency of each word in a sentence.
Show answer
You get ConcurrentModificationException while removing items from a list inside a for-each loop. How do you fix it?
Show answer
You are loading about five lakh records into an ArrayList and a HashMap and memory spikes during loading. What can you do?
Show answer
What are the correct and incorrect ways to use Optional?
Show answer
Describe a time you disagreed with a teammate during a code review.
Show answer
When should you use parallel streams and when should you avoid them?
Show answer
Implement a simple LRU cache in Java.
Show answer
An object put into a HashMap cannot be found later even though it looks equal. What could be wrong?
Show answer
A teammate replaced a simple for loop in a performance-critical path with a long stream pipeline. Is this a concern?
Show answer
What is Spring Boot and how is it different from the Spring Framework?
Show answer
Explain Inversion of Control and Dependency Injection.
Show answer
What does @SpringBootApplication do?
Show answer
Create a scheduled job that runs every night at 2 AM in Spring Boot.
Show answer
You need H2 for local development, MySQL for testing and PostgreSQL in production. How do you configure this?
Show answer
The application fails with NoSuchBeanDefinitionException for a service. How do you debug it?
Show answer
What bean scopes does Spring support?
Show answer
Why is constructor injection preferred over field injection?
Show answer
How do profiles and application.yml work in Spring Boot?
Show answer
Mentoring: how would you help a junior developer who keeps pushing untested Spring code?
Show answer
What is Spring Boot Actuator used for?
Show answer
What changed when moving from Spring Boot 2 to Spring Boot 3?
Show answer
Write global exception handling for a REST API in Spring Boot.
Show answer
Bind custom properties from application.yml into a type-safe class.
Show answer
Write a unit test for a service method using JUnit 5 and Mockito.
Show answer
Write a production-friendly Dockerfile for a Spring Boot application.
Show answer
Your application fails at startup with a circular dependency error between two services. What do you do?
Show answer
Database passwords and API keys are committed in application.properties. How do you fix this?
Show answer
Explain the architecture of your last full stack project end to end.
Show answer
Tell me about a time you delivered a feature under a tight deadline.
Show answer
How does Spring Boot auto-configuration work internally?
Show answer
How does @Transactional work, and why does calling it from the same class not work?
Show answer
Write a controller slice test with @WebMvcTest and MockMvc.
Show answer
A Spring Boot service takes nearly a minute to start. How would you speed it up?
Show answer
Your @Transactional method threw an exception but the data was still saved. Why?
Show answer
What is the difference between JPA, Hibernate and Spring Data JPA?
Show answer
How do derived query methods work in Spring Data JPA?
Show answer
What are the options for spring.jpa.hibernate.ddl-auto and which should be used in production?
Show answer
Write a JPA entity for a Product with an auto-generated ID and basic constraints.
Show answer
How do you learn a new framework or library quickly when a project needs it?
Show answer
What are the entity lifecycle states in JPA?
Show answer
What is the difference between lazy and eager fetching?
Show answer
What is the N+1 select problem and how do you solve it?
Show answer
What is the difference between persist and merge, and between save and saveAndFlush?
Show answer
In a bidirectional @OneToMany relationship, what does mappedBy mean?
Show answer
What causes LazyInitializationException and how do you fix it properly?
Show answer
Write a repository query that loads orders with their items in one query.
Show answer
Implement pagination and sorting for a product list API.
Show answer
Return only a few columns using an interface-based projection.
Show answer
Write a Flyway migration to add a column and index to an existing table.
Show answer
Returning an entity from a REST API causes infinite recursion in JSON. Why, and how do you fix it?
Show answer
The business wants deleted customers to be recoverable. How would you implement soft delete with JPA?
Show answer
What are cascade types and orphanRemoval in JPA?
Show answer
Explain the first-level and second-level cache in Hibernate.
Show answer
How does optimistic locking work with @Version?
Show answer
Build a dynamic search with optional filters using JPA Specifications.
Show answer
A product listing page fires hundreds of SQL queries for one request. How do you fix it?
Show answer
Two admins edit the same product price at the same time and one change is silently lost. How do you prevent this?
Show answer
Inserting one lakh rows with saveAll takes many minutes. How do you speed it up?
Show answer
Describe a time you improved the performance of an application.
Show answer
What are the key principles of a RESTful API?
Show answer
Which HTTP methods are safe and which are idempotent?
Show answer
Explain the common HTTP status codes a REST API should return.
Show answer
What is the difference between authentication and authorization?
Show answer
Write a basic CRUD REST controller in Spring Boot.
Show answer
How do you store user passwords securely in Spring Boot? Show the code.
Show answer
How do you work with frontend developers and testers on API changes?
Show answer
How does JWT-based authentication work?
Show answer
What is CORS and how do you configure it for a React frontend?
Show answer
Compare monolithic and microservices architecture.
Show answer
What roles do an API gateway and service discovery play in microservices?
Show answer
Add request validation to a registration API.
Show answer
Call another microservice from Spring Boot using RestClient with a timeout.
Show answer
Your React app gets 403 Forbidden on POST requests to Spring Boot, but GET works. What is the likely cause?
Show answer
Your public API is being hit by too many requests from a few clients. How do you add rate limiting?
Show answer
Users must upload files up to 200 MB. How do you design the upload API?
Show answer
How do you version a REST API?
Show answer
Tell me about a production incident you handled.
Show answer
How do you handle a requirement that is unclear or keeps changing?
Show answer
How does the Spring Security filter chain process a request?
Show answer
What is the circuit breaker pattern and how is it implemented in Spring?
Show answer
Configure Spring Security 6 for a stateless JWT-secured REST API.
Show answer
A user's JWT is stolen and you need to invalidate it before expiry. How would you design for this?
Show answer
An order service and a payment service have separate databases. How do you keep data consistent when placing an order?
Show answer
A downstream service is slow, and your API threads are all stuck waiting. What do you do?
Show answer
What is the difference between a primary key and a unique key?
Show answer
Explain the different types of SQL joins.
Show answer
What is the difference between WHERE and HAVING?
Show answer
What are ACID properties?
Show answer
What is the difference between DELETE, TRUNCATE and DROP?
Show answer
Write a query to find the second highest salary from an employees table.
Show answer
Write a query to find duplicate email addresses in a users table and delete the extra rows.
Show answer
A security review found a login query built by string concatenation. What is the risk and the fix?
Show answer
What is normalization? Explain 1NF, 2NF and 3NF.
Show answer
How do indexes improve performance, and when can they hurt?
Show answer
What are window functions and how are they different from GROUP BY?
Show answer
Find the top 3 highest-paid employees in each department.
Show answer
Find employees who earn more than their managers.
Show answer
Write a query that shows daily sales with a running total for the month.
Show answer
A search query that used to take milliseconds now takes 10 seconds as data grew. How do you troubleshoot?
Show answer
You are designing a new feature. When would you choose a relational database and when a NoSQL database?
Show answer
Tell me about a mistake you made with production data and how you handled it.
Show answer
Explain the database design of a project you have worked on.
Show answer
What is the difference between a clustered and a non-clustered index?
Show answer
Explain transaction isolation levels and the problems each one prevents.
Show answer
How does column order matter in a composite index?
Show answer
How do you use EXPLAIN to analyse a slow query?
Show answer
Your application logs show database deadlock errors during peak hours. How do you resolve them?
Show answer
Under load, requests fail with a connection timeout from HikariCP. What do you check?
Show answer
Paging through a large table with OFFSET becomes very slow on later pages. What is a better approach?
Show answer
What is React and what is the virtual DOM?
Show answer
What is the difference between props and state?
Show answer
Why does React need a key prop when rendering lists?
Show answer
How do you take feedback from a senior on your React code?
Show answer
Implement a cart counter using useReducer.
Show answer
You are passing the same user prop through five levels of components. What would you do?
Show answer
How do you handle a disagreement with a UI designer about a screen?
Show answer
How does the useEffect dependency array work?
Show answer
What is the difference between controlled and uncontrolled components?
Show answer
When should you use useMemo and useCallback?
Show answer
When would you use the Context API and when a state library like Redux Toolkit or Zustand?
Show answer
What is a custom hook and why would you write one?
Show answer
How do code splitting and lazy loading work in React?
Show answer
Fetch a list of products from an API and show loading and error states.
Show answer
Write a reusable useFetch custom hook.
Show answer
Build a login form with basic validation in React.
Show answer
Your component keeps re-rendering in an infinite loop after calling an API. What is wrong?
Show answer
After calling setCount(count + 1), console.log(count) still shows the old value. Why?
Show answer
What is the biggest full stack project you have built?
Show answer
What triggers a re-render in React, and how does reconciliation decide what to update?
Show answer
Create a protected route in React Router that redirects unauthenticated users to login.
Show answer
Add the JWT to every API call and handle 401 responses using an Axios interceptor.
Show answer
A table showing 10,000 rows makes the page very slow. How would you improve it?
Show answer
Where should a React app store the JWT, and what are the trade-offs?
Show answer
In a search box, older API responses sometimes overwrite newer results. How do you fix this race condition?
Show answer
What is the difference between var, let and const?
Show answer
What is the difference between == and === in JavaScript?
Show answer
What is hoisting in JavaScript?
Show answer
Explain the CSS box model.
Show answer
When would you use Flexbox and when CSS Grid?
Show answer
Why are semantic HTML and accessibility important?
Show answer
Use map, filter and reduce to get the total value of in-stock products.
Show answer
Centre a div horizontally and vertically using CSS.
Show answer
Write CSS for a product grid that shows 1 column on mobile, 2 on tablet and 4 on desktop.
Show answer
The layout looks fine on desktop but breaks on mobile with horizontal scrolling. How do you debug it?
Show answer
How do you handle a Git merge conflict when working in a team?
Show answer
What is a closure in JavaScript? Give a practical use.
Show answer
Compare promises and async/await.
Show answer
How does the this keyword work, and how do arrow functions change it?
Show answer
Write a debounce function in JavaScript.
Show answer
Call three APIs in parallel and handle failure of any one gracefully.
Show answer
How do you deep clone an object in JavaScript?
Show answer
What is event delegation and why is it useful?
Show answer
Your team is starting a new React project. Would you use Create React App or something else?
Show answer
What is the difference between localStorage, sessionStorage and cookies?
Show answer
Why should we hire you as a Java full stack developer?
Show answer
Explain the JavaScript event loop, including microtasks and macrotasks.
Show answer
Your React app's home page takes 6 seconds to load on mobile. How would you improve it?
Show answer
A security test shows a stored XSS vulnerability in a comments feature. How do you fix it?
Show answer
Memory usage of a single-page app keeps growing the longer it stays open. What could cause this?
Show answer
Frequently asked questions
What jobs can I get after learning Java full stack with React?
You can apply for roles such as Java full stack developer, Spring Boot backend developer, React frontend developer, software engineer and associate software engineer. These roles exist in IT services companies, banks and fintech firms, global capability centres and startups across Bengaluru, Hyderabad, Pune, Noida, Gurugram and Chennai. With experience, you can grow into senior engineer, technical lead or solution architect roles. A strong project portfolio and good fundamentals matter more than the course title.
Who is eligible to learn Java full stack development?
Anyone with basic computer knowledge and logical thinking can start. B.Tech, BCA, MCA, B.Sc and diploma students are common learners, and working professionals from testing, support or non-IT backgrounds also switch successfully. Prior coding experience helps but is not required, because the course starts with Java fundamentals. Recruiters for fresher roles usually check graduation status and percentage cut-offs, so confirm those for the companies you target.
How long does it take to become job-ready in Java full stack?
With consistent study of 2 to 3 hours a day, most learners become job-ready in about 6 months. Core Java and SQL take around two months, web basics and React about two months, and Spring Boot, security and deployment about two more. The timeline depends on daily practice, coding problem solving and building two or three complete projects. Working professionals studying part-time may need 7 to 9 months.
Is Java full stack still in demand in 2026?
Yes. Java remains one of the most used languages for enterprise backends, especially in banking, insurance, telecom, retail and government projects, and Spring Boot is the default framework for new Java services. React is the most popular frontend library. Companies value developers who can work on both layers and understand cloud deployment. AI coding tools speed up routine work, so strong fundamentals, debugging and system design skills are what set candidates apart.
Which certifications help a Java full stack developer?
Certifications are optional but can strengthen a fresher's resume. Useful ones include Oracle Certified Professional Java SE 17 or 21 Developer, the Spring Certified Professional, and a cloud certification such as AWS Certified Developer Associate or Azure Developer Associate. A course completion certificate shows training, but interviewers mainly judge projects, GitHub activity and how well you answer technical questions, so treat certifications as a supplement.
Do I need to learn data structures and algorithms for Java full stack interviews?
Yes, at least the basics. Service companies test arrays, strings, hashing, sorting and simple recursion in online assessments, while product companies and banks also ask linked lists, trees, graphs and dynamic programming. Practise in Java so you also strengthen your collections knowledge. Aim to solve around 150 to 200 well-chosen problems alongside your projects, focusing on understanding patterns rather than memorising solutions.