Java Interview Questions for Freshers
Published August 18, 2026 · 7 min read
For a fresher, Java interviews rarely go beyond four areas: core OOP concepts, how Strings and collections actually work under the hood, checked vs. unchecked exceptions, and one live coding problem. Service companies like TCS, Infosys, and Wipro lean especially hard on OOP fundamentals since their codebases are Java-heavy — if you only have time to prepare one thing, make it that.
OOP Concepts You Must Know Cold
Abstraction vs. encapsulation
These get mixed up constantly. Abstraction hides complexity — showing only what a class does, not how (interfaces and abstract classes). Encapsulation hides data — bundling fields with the methods that operate on them, and restricting direct access with private fields and getters/setters. One's about hiding implementation, the other's about hiding state.
Overloading vs. overriding
Overloading is same method name, different parameters, resolved at compile time — it's really just a naming convenience. Overriding is a subclass redefining a parent's method with the exact same signature, resolved at runtime via dynamic dispatch. If an interviewer asks "which one is polymorphism?" — it's overriding.
Common Java Technical Questions
Why is String immutable in Java? Three real reasons: security (Strings are used for things like file paths and network connections, so they shouldn't change underneath you), thread-safety (immutable objects are automatically safe to share across threads), and performance (the JVM can cache and reuse Strings via the string pool because it knows they won't change).
== vs. .equals(). == compares references (are these the same object in memory?). .equals() compares values, if the class overrides it — which is why comparing two Strings with == is a classic beginner bug.
ArrayList vs. LinkedList. ArrayList is backed by a dynamic array — fast random access (O(1)), slower insertion/deletion in the middle (O(n), since elements shift). LinkedList is a doubly-linked list — the reverse trade-off: slow random access (O(n)), fast insertion/deletion once you're at the right node (O(1)).
Checked vs. unchecked exceptions. Checked exceptions (like IOException) must be declared or caught at compile time — the compiler forces you to handle them. Unchecked exceptions (subclasses of RuntimeException, like NullPointerException) aren't enforced at compile time; they usually signal a programming bug rather than a recoverable condition.
A Coding Question You Should Expect
Something short enough to finish in 10–15 minutes: reverse a string without using a built-in reverse method, find the first non-repeating character in a string, or check if two strings are anagrams. Interviewers are watching whether you can talk through your approach before writing code, not just whether the final answer compiles.
How to Prepare
If you're specifically prepping for a service-company drive, read our TCS interview questions guide alongside this one — the technical round structure there applies broadly to Infosys and Wipro too. Then practice explaining these concepts out loud, not just reading them, with a live-scored AI Mock Interview or daily reps on Flash Practice.
Frequently Asked Questions
What Java topics come up most often in fresher interviews? OOP fundamentals (abstraction vs. encapsulation, overloading vs. overriding), how Strings and collections work internally, checked vs. unchecked exceptions, and one live coding problem.
Why is String immutable in Java? Three reasons: security (Strings are used in file paths and network connections and shouldn't change underneath you), thread-safety (immutable objects are inherently safe to share across threads), and performance (the JVM can cache and reuse Strings via the string pool).
What's the difference between == and .equals() in Java? == compares object references — are these the same object in memory? .equals() compares values if the class overrides it, which is why comparing two Strings with == is a classic beginner bug.
ArrayList or LinkedList — which should I use? ArrayList (backed by a dynamic array) gives fast random access but slower middle insertion/deletion. LinkedList gives the reverse trade-off: slow random access, fast insertion/deletion once you're at the right node.