JAVA TECHNICAL INTERVIEW QUESTIONS
1. Core Java Basics
1. What is Java?
2. What are the main features of Java?
3. Why is Java platform independent?
4. What is JVM?
5. What is JDK?
6. What is JRE?
7. Difference between JDK, JRE and JVM.
8. What is bytecode?
9. What is the difference between Java and C++?
10. What are the four pillars of OOP?
11. What is a class?
12. What is an object?
13. Difference between class and object.
14. What is a constructor?
15. What are the types of constructors?
16. Can a constructor be overloaded?
17. Can a constructor be inherited?
18. What is the main() method in Java?
19. Why is main() declared as public static void?
2. OOP Concepts – Very Important
1. What is inheritance?
2. What are the types of inheritance?
3. Does Java support multiple inheritance?
4. Why doesn't Java support multiple inheritance using classes?
5. What is polymorphism?
6. Difference between compile-time and runtime polymorphism.
7. What is method overloading?
8. What is method overriding?
9. Difference between overloading and overriding.
10. What is encapsulation?
11. What is abstraction?
12. Difference between abstraction and encapsulation.
13. What is an abstract class?
14. What is an interface?
15. Difference between abstract class and interface.
16. Can an abstract class have a constructor?
17. Can an interface have methods with implementation?
18. What is the super keyword?
19. What is the this keyword?
20. Difference between this and super.
3. Strings
1. What is a String in Java?
2. Why is String immutable?
3. Difference between String, StringBuilder, and StringBuffer.
4. Difference between == and .equals().
5. What is the String Constant Pool?
6. How many objects are created by String s = new String("Java")?
7. How do you reverse a String?
8. How do you check whether a String is a palindrome?
9. How do you count the frequency of characters in a String?
10. How do you remove duplicate characters from a String?
4. Arrays
1. What is an array?
2. How do you declare an array in Java?
3. Difference between one-dimensional and two-dimensional arrays.
4. How do you find the largest element in an array?
5. How do you find the second-largest element?
6. How do you reverse an array?
7. How do you remove duplicates from an array?
8. How do you find duplicate elements?
9. How do you sort an array?
10. How do you find the missing number in an array?
5. Collections Framework
1. What is the Java Collection Framework?
2. Difference between Collection and Collections.
3. Difference between List, Set and Map.
4. Difference between ArrayList and LinkedList.
5. Difference between HashSet and TreeSet.
6. Difference between HashMap and Hashtable.
7. How does HashMap work internally?
8. Can HashMap contain duplicate keys?
9. Can HashMap contain null keys?
10. What is an Iterator?
11. Difference between Iterator and ListIterator.
12. What is Comparable?
13. What is Comparator?
14. Difference between Comparable and Comparator.
15. When would you use ArrayList instead of LinkedList?
6. Exception Handling
1. What is an exception?
2. Difference between error and exception.
3. What is exception handling?
4. What is try-catch?
5. What is finally?
6. Difference between throw and throws.
7. Difference between checked and unchecked exceptions.
8. Can we have multiple catch blocks?
9. Can finally be skipped?
10. Can we use try without catch?
11. How do you create a custom exception?
7. Access Modifiers & Keywords
1. What are access modifiers in Java?
2. Difference between public, private, protected and default.
3. What is static?
4. What is a static variable?
5. What is a static method?
6. Can a static method access a non-static variable directly?
7. What is final?
8. Difference between final, finally and finalize.
9. What is the transient keyword?
10. What is the volatile keyword?
8. Java 8+ Concepts
1. What is a Lambda Expression?
2. What is a Functional Interface?
3. What is the @FunctionalInterface annotation?
4. What is Stream API?
5. Difference between map() and filter().
6. What is forEach()?
7. What is Optional?
8. What is a method reference?
9. What are default methods in interfaces?
10. What are static methods in interfaces?
9. Multithreading
1. What is a thread?
2. Difference between process and thread.
3. How can you create a thread in Java?
4. Difference between extending Thread and implementing Runnable.
5. What is the thread lifecycle?
6. What is synchronization?
7. What is a race condition?
8. What is deadlock?
9. What is sleep()?
10. Difference between sleep() and wait().
11. Difference between notify() and notifyAll().
10. Common Java Coding Questions
1. Reverse a number.
2. Reverse a String.
3. Check palindrome.
4. Check prime number.
5. Print prime numbers within a range.
6. Find factorial of a number.
7. Generate Fibonacci series.
8. Check Armstrong number.
9. Find largest element in an array.
10. Find second-largest element.
11. Find duplicate elements in an array.
12. Remove duplicates from an array.
13. Find the missing number.
14. Count vowels and consonants.
15. Count character frequency.
16. Count words in a String.
17. Reverse each word in a sentence.
18. Check whether two Strings are anagrams.
19. Sort an array without using built-in sorting.
20. Find common elements between two arrays.
21. Find the sum of array elements.
22. Find even and odd numbers.
23. Swap two numbers without a third variable.
24. Find factorial using recursion.
25. Reverse a String using recursion.
11. Top 20 Questions – Priority Preparation
Priority Question
1 JDK vs JRE vs JVM
2 Four pillars of OOP
3 Overloading vs Overriding
4 Abstract class vs Interface
5 == vs .equals()
6 String immutability
7 ArrayList vs LinkedList
8 HashMap internal working
9 HashSet vs HashMap
10 Checked vs Unchecked Exception
11 throw vs throws
12 final vs finally vs finalize
13 this vs super
14 static keyword
15 Constructor
16 Encapsulation
17 Polymorphism
18 Lambda Expression
19 Stream API
20 Thread vs Process