0% found this document useful (0 votes)
3 views3 pages

Java Spring Interview Guide (1)

This document is a comprehensive interview preparation guide for Java and Spring Boot, targeting candidates with over 6 years of experience. It includes a detailed list of topics and over 100 interview questions covering core Java concepts, OOP principles, collections, exception handling, Java 8 features, file I/O, JVM internals, design patterns, unit testing, and best practices. Each section contains specific questions aimed at assessing the candidate's knowledge and practical skills in Java programming.

Uploaded by

cabat64522
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Java Spring Interview Guide (1)

This document is a comprehensive interview preparation guide for Java and Spring Boot, targeting candidates with over 6 years of experience. It includes a detailed list of topics and over 100 interview questions covering core Java concepts, OOP principles, collections, exception handling, Java 8 features, file I/O, JVM internals, design patterns, unit testing, and best practices. Each section contains specific questions aimed at assessing the candidate's knowledge and practical skills in Java programming.

Uploaded by

cabat64522
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Comprehensive Java & Spring Boot Interview Preparation Guide (6+ Years Experience)

📖 Part 1: Detailed Topic & Subtopic List

...[unchanged above content]...

🔎 Java Interview Questions (100+)

✅ Core Concepts & OOP (Theory & Code)

1. What is the difference between == and .equals() in Java?


2. Explain all four OOP principles with real-world examples.
3. What is method overloading and overriding? Provide examples.
4. Can we override static methods in Java?
5. Why is Java not 100% Object-Oriented?
6. How does constructor chaining work?
7. What is a copy constructor? How is it implemented in Java?
8. Difference between shallow copy and deep copy?
9. What is the use of this and super keywords?
10. What is the final keyword in Java?

✅ Java Basics

1. What are the different data types available in Java?


2. How is type casting handled in Java?
3. What is the difference between break and continue ?
4. What is the default value of instance variables?
5. Explain the difference between == , != , equals() and compareTo() .
6. What are wrapper classes in Java?
7. What is autoboxing and unboxing?
8. How does switch statement work?
9. What are command-line arguments?
10. What is the purpose of static keyword?

✅ Collections

1. Difference between ArrayList and LinkedList?


2. How does HashMap work internally?
3. What is the difference between HashMap and Hashtable?
4. What is the load factor and initial capacity in HashMap?
5. How to make a HashMap thread-safe?
6. What are the main differences between Set and List?
7. What is the difference between HashSet and TreeSet?
8. Explain the working of ConcurrentHashMap.
9. How does fail-fast vs fail-safe iterator work?
10. What is the difference between Iterator and ListIterator?

✅ Exception Handling

1. What is the difference between checked and unchecked exceptions?

1
2. How to create a custom exception?
3. What happens if you catch only Exception ?
4. Can we have multiple catch blocks?
5. Difference between throw and throws ?
6. What is the use of finally block?
7. Can finally block override a return statement?
8. How to handle exceptions in lambda expressions?
9. What is the purpose of try-with-resources?
10. What happens if an exception is not caught?

✅ Java 8 Features

1. What are the benefits of Lambda expressions?


2. Difference between Predicate and Function interfaces?
3. How to sort a list using Comparator with lambda?
4. What is Optional and how is it used?
5. Difference between map() and flatMap()?
6. What is the use of method reference?
7. How does Stream API improve performance?
8. What is the difference between sequential and parallel streams?
9. What is a functional interface?
10. What are default and static methods in interfaces?

✅ File I/O & NIO

1. Difference between FileReader and FileInputStream?


2. What is the use of BufferedReader?
3. How do you write text to a file in Java?
4. What is the use of java.nio package?
5. How do you read a large file efficiently?
6. What is Path vs File in NIO?
7. How to list all files in a directory?
8. What is the use of Files.lines()?
9. How to write objects to a file using serialization?
10. What is the role of Serializable interface?

✅ JVM Internals

1. What are the different memory areas in JVM?


2. Explain the role of ClassLoader.
3. How garbage collection works?
4. What are the types of garbage collectors?
5. What is PermGen/Metaspace?
6. What is the difference between stack and heap memory?
7. What is OutOfMemoryError?
8. What is the purpose of JIT compiler?
9. How to monitor JVM memory usage?
10. What are Soft, Weak, and Phantom references?

✅ Design Patterns

1. What is Singleton pattern? How to implement it?

2
2. Explain Factory Design Pattern with an example.
3. What is the Builder pattern and where is it used?
4. Difference between Strategy and State patterns?
5. What is the Observer pattern?
6. What are the SOLID principles?
7. Explain Dependency Injection as a pattern.
8. What is the Template Method Pattern?
9. Difference between Adapter and Decorator patterns?
10. Explain MVC architecture in Java.

✅ Unit Testing

1. What is the use of JUnit?


2. How to write a test case in JUnit 5?
3. Difference between @BeforeEach , @BeforeAll , @AfterEach , @AfterAll ?
4. How to test exceptions in JUnit?
5. What is Mockito and why is it used?
6. How to mock a service call using Mockito?
7. What is Test Coverage?
8. What is the use of assertions?
9. How to test private methods?
10. Difference between unit, integration, and functional tests?

✅ Miscellaneous & Best Practices

1. What is immutability in Java? How to make a class immutable?


2. Difference between deep cloning and shallow cloning?
3. What is the purpose of transient keyword?
4. What is volatile keyword? Where is it used?
5. Explain double-checked locking in Singleton.
6. Difference between Enumeration and Iterator?
7. How do you prevent serialization of sensitive fields?
8. Why are Strings immutable in Java?
9. What are method handles?
10. What is record type introduced in Java 14?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy