Java Interview Questions for Freshers (India, 2026): Core Java, OOP, Collections & Coding
Java is still the most common language in fresher technical interviews in India — at service companies like TCS, Infosys, Wipro, Cognizant and Accenture, and at many product startups. Interviewers rarely want trick answers. They check whether you understand the fundamentals, can write a small program without help, and can explain your own project. Here are the question types you will actually face, grouped by topic, with what a good answer covers.
How Java is tested in fresher interviews
- Online assessment — MCQs on output prediction, OOP and exceptions, plus one or two coding problems.
- Technical interview — core Java concepts, a short program written live or on paper, and questions on your project.
- Follow-up depth — product companies go further into collections internals, multithreading and complexity.
- HR round — communication, relocation and why you chose Java or this company.
Selection steps and test sections change between hiring drives. Always confirm the current pattern on the company's official careers page or your drive invitation before you prepare.
Core Java basics
- What is the difference between JDK, JRE and JVM?
- Why is Java platform independent? What is bytecode?
- Why is the main method public static void? Can we overload it?
- What are primitive data types and wrapper classes? What is autoboxing?
- Difference between == and .equals().
- What do the final, finally and finalize keywords mean?
- What is the static keyword used for — variables, methods, blocks?
- Difference between stack and heap memory. What does the garbage collector do?
OOP questions (asked in almost every interview)
- Explain the four pillars of OOP with a real example from your project.
- Difference between method overloading and overriding.
- Difference between an abstract class and an interface. When would you use each?
- Why does Java not support multiple inheritance with classes?
- What is a constructor? Can a constructor be private? What is constructor chaining?
- What do this and super refer to?
- What are access modifiers? Explain default vs protected.
Strings and exceptions
- Why are Strings immutable? What is the String pool?
- Difference between String, StringBuilder and StringBuffer.
- Checked vs unchecked exceptions, with examples.
- Difference between throw and throws. Can we have try without catch?
- How do you create a custom exception?
Collections framework
- Difference between ArrayList and LinkedList; ArrayList and array.
- Difference between HashMap, Hashtable and ConcurrentHashMap.
- How does HashMap work internally? What are hashCode() and equals() used for?
- Difference between HashSet and TreeSet; List and Set.
- Comparable vs Comparator.
- What is a fail-fast iterator?
Multithreading and Java 8
- Two ways to create a thread. Runnable vs extending Thread.
- What is synchronization? What is a deadlock?
- Difference between wait() and sleep().
- What are lambda expressions and functional interfaces?
- What is the Stream API? Write a stream to filter even numbers from a list.
- What is Optional used for?
Coding programs to practise in Java
- Reverse a string without using reverse().
- Check whether a string is a palindrome.
- Check prime numbers, print the Fibonacci series, find the factorial.
- Find duplicate elements in an array.
- Count the occurrences of each character in a string using a HashMap.
- Find the second largest number in an array.
- Swap two numbers without a third variable.
- Sort an array without Arrays.sort() (bubble or selection sort).
Say your approach out loud before writing code, then mention the time complexity. Interviewers score your reasoning, not just the final output.
Project and HR questions
- Explain your project. Which Java concepts did you use and why?
- What was the hardest bug you fixed?
- Tell me about yourself.
- Why should we hire you as a Java developer?
2-week Java prep plan
- Days 1–3: core Java basics, OOP — write your own one-line answer for each question above.
- Days 4–6: strings, exceptions and collections, with small programs for each.
- Days 7–8: multithreading basics and Java 8 lambdas and streams.
- Days 9–11: two coding programs a day from the list, written without an IDE.
- Day 12: prepare a 2-minute project explanation and 'tell me about yourself'.
- Days 13–14: take full mock interviews out loud and fix the weak answers.
Recommended next action
Take the next concrete step — it's free, takes under a minute, and gives you a real score to act on.