Interview Preparation

Complete Java Full Stack / Backend
Interview Questions

A structured question bank covering Core Java, Spring Boot, REST APIs, JPA/Hibernate, Microservices, Kafka, Security, DevOps, Angular, and real-time project scenarios.

133 Interview Questions
17 Topic Areas
Java Full Stack / Backend
01

CORE JAVA BASICS

  1. 1.What are the key features of Java and why is it widely used?
  2. 2.How does Java achieve platform independence?
  3. 3.Explain JVM, JRE, and JDK with roles.
  4. 4.What is memory management in Java?
  5. 5.Difference between stack memory and heap memory?
  6. 6.What are access modifiers and where did you use them?
  7. 7.What is the use of final keyword in real projects?
  8. 8.Difference between == and equals()?
  9. 9.Difference between equals() and hashCode()?
  10. 10.Why is Java considered robust and secure?
02

OOPS CONCEPTS

  1. 1.What is encapsulation and how did you apply it?
  2. 2.What is inheritance and why is it used?
  3. 3.What is polymorphism with real-time example?
  4. 4.Difference between compile-time and runtime polymorphism?
  5. 5.Method overloading vs method overriding?
  6. 6.Can we override static methods? Why?
  7. 7.Can we override private methods?
  8. 8.What is abstraction and how is it achieved?
  9. 9.Abstract class vs interface?
  10. 10.Why multiple inheritance is not supported in Java?
03

STRING & IMMUTABILITY

  1. 1.Why is String immutable in Java?
  2. 2.Difference between String, StringBuilder, and StringBuffer?
  3. 3.How does String Constant Pool work?
  4. 4.What happens when we create String using new keyword?
  5. 5.Why String is thread-safe?
  6. 6.How do you compare Strings correctly?
  7. 7.How to improve performance while handling Strings?
04

EXCEPTION HANDLING

  1. 1.What is exception handling and why is it important?
  2. 2.Difference between checked and unchecked exceptions?
  3. 3.Difference between throw and throws?
  4. 4.Can we have try block without catch?
  5. 5.What is finally block and when it won’t execute?
  6. 6.Can overridden methods throw exceptions?
  7. 7.How do you create custom exceptions?
  8. 8.Difference between Exception and Error?
05

MULTITHREADING & CONCURRENCY

  1. 1.What is multithreading and why is it needed?
  2. 2.Difference between process and thread?
  3. 3.How do you create threads in Java?
  4. 4.Runnable vs Thread class?
  5. 5.What is thread lifecycle?
  6. 6.What is synchronization?
  7. 7.What is deadlock and how to avoid it?
  8. 8.Difference between synchronized and volatile?
  9. 9.What are wait(), notify(), notifyAll()?
  10. 10.What is Executor framework?
06

COLLECTIONS FRAMEWORK

  1. 1.What is Collection framework?
  2. 2.Difference between List, Set, and Map?
  3. 3.Difference between ArrayList and LinkedList?
  4. 4.Difference between HashSet and TreeSet?
  5. 5.Difference between HashMap and Hashtable?
  6. 6.Difference between HashMap and ConcurrentHashMap?
  7. 7.How does HashMap work internally?
  8. 8.What happens when two keys have same hashcode?
  9. 9.Why HashMap allows one null key?
  10. 10.What is load factor and capacity in HashMap?
07

COLLECTIONS – ADVANCED

  1. 1.What is fail-fast and fail-safe iterator?
  2. 2.Iterator vs ListIterator?
  3. 3.Why Map is not part of Collection?
  4. 4.Comparable vs Comparator?
  5. 5.How do you sort custom objects?
  6. 6.What is immutable collection?
  7. 7.How do you make collections thread-safe?
  8. 8.Difference between Array and ArrayList?
  9. 9.What is Collections utility class?
  10. 10.How equals() and hashCode() work together?
08

JAVA 8 & STREAMS

  1. 1.What are Java 8 features you used in project?
  2. 2.What is Stream API?
  3. 3.Difference between stream() and parallelStream()?
  4. 4.map() vs flatMap()?
  5. 5.What is Optional and why is it used?
  6. 6.How do you remove duplicates using streams?
  7. 7.How do streams improve performance?
  8. 8.How does lambda expression work internally?
09

SPRING & SPRING BOOT

  1. 1.Why Spring Boot over Spring MVC?
  2. 2.What is dependency injection?
  3. 3.Explain IoC with real example.
  4. 4.What is DispatcherServlet?
  5. 5.Explain request lifecycle in Spring Boot.
  6. 6.@Controller vs @RestController?
  7. 7.@Component vs @Service vs @Repository?
  8. 8.How does Spring Boot auto-configuration work?
  9. 9.What is application.properties used for?
10

REST API & EXCEPTION HANDLING

  1. 1.How do you design RESTful APIs?
  2. 2.GET vs POST vs PUT vs PATCH?
  3. 3.What are HTTP status codes?
  4. 4.How do you handle validation?
  5. 5.How do you handle global exceptions?
  6. 6.What is @ControllerAdvice?
11

DATABASE & SQL

  1. 1.Why JPA over JDBC?
  2. 2.Difference between JPA and Hibernate?
  3. 3.Lazy loading vs eager loading?
  4. 4.What is N+1 query problem?
  5. 5.How do you optimize SQL queries?
  6. 6.Inner join vs outer join?
  7. 7.What is normalization?
  8. 8.How do you handle pagination?
12

MICROSERVICES

  1. 1.What is microservices architecture?
  2. 2.Monolithic vs microservices?
  3. 3.How do microservices communicate?
  4. 4.REST vs Kafka communication?
  5. 5.What is service discovery?
  6. 6.What is Eureka server?
  7. 7.What is API Gateway?
  8. 8.What is Config Server?
  9. 9.How do you handle inter-service failures?
13

KAFKA

  1. 1.Why Kafka is used?
  2. 2.Explain Kafka architecture.
  3. 3.What is topic, partition, consumer group?
  4. 4.How do you ensure message reliability?
  5. 5.How do you handle duplicate messages?
14

SECURITY

  1. 1.How did you implement Spring Security?
  2. 2.What is JWT and how it works?
  3. 3.How do you secure APIs?
  4. 4.Role-based access control?
15

DEVOPS & CLOUD

  1. 1.Explain CI/CD pipeline.
  2. 2.Why Docker?
  3. 3.How do you deploy Spring Boot apps?
  4. 4.What is cloud deployment strategy?
  5. 5.What are actuator endpoints?
  6. 6.How do you monitor applications?
16

FRONTEND (ANGULAR)

  1. 1.What is Angular?
  2. 2.What is two-way data binding?
  3. 3.ngModel vs reactive forms?
  4. 4.How Angular communicates with backend?
  5. 5.How do you handle UI errors?
17

DESIGN PATTERNS & REAL-TIME

  1. 1.What design patterns did you use?
  2. 2.Singleton pattern – use case and risk?
  3. 3.Factory pattern – real example?
  4. 4.Circuit breaker pattern?
  5. 5.What was the biggest challenge in your project?
  6. 6.How did you resolve production issues?
  7. 7.How do you handle concurrency in real-time systems?
  8. 8.Why should we hire you?