Java Interview Questions and Answers for Freshers 2026

Java rounds follow a predictable pattern. The interviewer starts with OOP, moves to Strings and equals(), asks how a HashMap works, checks Java 8 streams, touches multithreading, and ends with a short program you write by hand. This guide covers each of those in that order, with explanations, code you can run, and the mistakes interviewers listen for.
Every code example below was compiled and run, and the outputs shown are the real ones. Read a section, then close the page and explain it out loud. That's the skill the interview actually tests.
1. What Java interviews test
Expect most questions from the first column, and a few from the second if you have projects or internship experience.
Every fresher interview
- OOP: the four pillars, overloading vs overriding
- Strings, == vs equals()
- Exceptions: checked vs unchecked
- ArrayList, HashMap, HashSet
- Short programs written by hand
Strong candidates also know
- How HashMap works inside
- equals() and hashCode() contract
- Streams, lambdas, Optional
- Threads, synchronized, thread pools
- Heap vs stack, garbage collection
2. JDK, JRE, JVM and how Java runs
The JVM runs bytecode. The JRE is the JVM plus the standard libraries, enough to run programs. The JDK adds the tools to build them, such as the javac compiler. Since Java 11, you simply install a JDK.
javac Main.java # compiler: source code -> bytecode (Main.class)
java Main # JVM: loads the bytecode and runs itBytecode is the same on every operating system, and each OS has its own JVM. That is what "write once, run anywhere" means, and why Java is called platform independent. The JVM first interprets bytecode, then its JIT compiler compiles frequently used code into native machine code, so long-running Java programs get fast.
3. OOP with code
Don't just list the four pillars. Show them in one small example:
abstract class Shape { // abstraction: what, not how
abstract double area();
public String describe() {
return getClass().getSimpleName() + " with area " + String.format("%.2f", area());
}
}
class Circle extends Shape { // inheritance
private final double radius; // encapsulation: private state
Circle(double radius) { this.radius = radius; }
@Override
double area() { return Math.PI * radius * radius; }
}
class Rectangle extends Shape {
private final double width, height;
Rectangle(double width, double height) { this.width = width; this.height = height; }
@Override
double area() { return width * height; }
}
for (Shape s : List.of(new Circle(1), new Rectangle(2, 3))) {
System.out.println(s.describe()); // polymorphism: each object's own area()
}
// Circle with area 3.14
// Rectangle with area 6.00Overloading vs overriding
class Calculator {
int add(int a, int b) { return a + b; } // overloading: same name,
double add(double a, double b) { return a + b; } // different parameters, chosen at compile time
}
class Animal { String sound() { return "..."; } }
class Dog extends Animal {
@Override
String sound() { return "Woof"; } // overriding: chosen at runtime
}
Animal a = new Dog();
System.out.println(a.sound()); // Woof - the object's real type decides, not the variable'sAbstract class vs interface (Java 8 and later)
The old answer "interfaces only have abstract methods" is out of date. Since Java 8, interfaces can have default and static methods, and since Java 9, private ones:
interface Payable {
double amount(); // abstract
default String receipt() { return "Paid " + amount(); } // Java 8: default method
static Payable of(double value) { return () -> value; } // Java 8: static method
}
System.out.println(Payable.of(250).receipt()); // Paid 250.0The real differences today: an abstract class can hold instance fields (state) and constructors; an interface can't. A class extends one class but can implement many interfaces. Use an abstract class to share state and code between closely related classes; use an interface to define a capability that unrelated classes can have.
4. Strings, equals and hashCode
String a = "java";
String b = "java";
String c = new String("java");
System.out.println(a == b); // true - literals share one object in the String pool
System.out.println(a == c); // false - new String() creates a separate object
System.out.println(a.equals(c)); // true - same charactersStrings are immutable: every "change" creates a new object. That makes them safe to share between threads, safe as HashMap keys, and lets the JVM reuse literals from the pool. For building text in a loop, use StringBuilder:
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 5; i++) sb.append(i); // one buffer, changed in place
System.out.println(sb.toString()); // 01234
// StringBuffer does the same but is synchronized: thread-safe and slower. Rarely needed today.The equals() and hashCode() contract
If two objects are equal, they must have the same hash code. Override equals() without hashCode() and HashSet and HashMap stop finding your objects:
public final class Employee {
private final int id;
private final String name;
public Employee(int id, String name) { this.id = id; this.name = name; }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Employee other)) return false;
return id == other.id && Objects.equals(name, other.name);
}
@Override
public int hashCode() { return Objects.hash(id, name); }
}
Set<Employee> set = new HashSet<>(List.of(new Employee(1, "Asha")));
set.contains(new Employee(1, "Asha")); // true
// With equals() but no hashCode(), the same check returns false.
// Since Java 16, a record writes equals(), hashCode() and toString() for you:
public record Employee(int id, String name) {}5. Exception handling
Checked exceptions (IOException, SQLException) must be caught or declared; the compiler enforces it. Unchecked ones extend RuntimeException (NullPointerException, IllegalArgumentException) and usually mean a bug or invalid input.
// try-with-resources closes the reader automatically, even when an exception is thrown
try (BufferedReader reader = Files.newBufferedReader(Path.of("data.txt"))) {
System.out.println(reader.readLine());
} catch (IOException e) { // checked: you must handle it
System.err.println("Could not read file: " + e.getMessage());
} finally {
System.out.println("Runs whether or not an exception happened");
}
// A custom unchecked exception
public class InsufficientBalanceException extends RuntimeException {
public InsufficientBalanceException(String message) { super(message); }
}
void withdraw(double amount) {
if (amount > balance) {
throw new InsufficientBalanceException("Balance too low"); // throw: raise it now
}
balance -= amount;
}
void loadConfig() throws IOException { ... } // throws: declares it, the caller must handle itException and doing nothing, losing the original exception when wrapping it (pass it as the cause: new AppException("msg", e)), and using exceptions for normal control flow.6. Collections and HashMap
List
Ordered, allows duplicates
ArrayList, LinkedList
Set
No duplicates
HashSet, LinkedHashSet, TreeSet
Map
Key to value, unique keys
HashMap, LinkedHashMap, TreeMap
How HashMap works inside
- HashMap keeps an array of buckets (16 by default).
put(key, value)callskey.hashCode(), spreads the bits, and picks a bucket from it.- Keys that land in the same bucket (a collision) are stored together;
equals()finds the right one. Since Java 8, a bucket with 8 or more entries becomes a balanced tree (when the table has at least 64 buckets), so a bad hash degrades lookups to O(log n) instead of O(n). - When the map is 75% full (load factor 0.75), it doubles its buckets and redistributes the entries.
- It allows one
nullkey, isn't thread-safe, and doesn't keep any order.
// Count characters: merge() adds 1 to the existing count, or starts at 1
Map<Character, Integer> freq = new HashMap<>();
for (char ch : "banana".toCharArray()) {
freq.merge(ch, 1, Integer::sum);
}
System.out.println(freq); // {a=3, b=1, n=2}Sorting with Comparator
record Student(String name, int marks) {}
List<Student> students = new ArrayList<>(List.of(
new Student("Asha", 82), new Student("Ravi", 91), new Student("Meera", 82)));
// highest marks first, then by name
students.sort(Comparator.comparingInt(Student::marks).reversed()
.thenComparing(Student::name));
// [Student[name=Ravi, marks=91], Student[name=Asha, marks=82], Student[name=Meera, marks=82]]Comparable is the class's one natural order (compareTo, inside the class). Comparator is any order you pass in from outside, and you can have as many as you need.
The classic trap: removing while iterating
List<Integer> nums = new ArrayList<>(List.of(1, 2, 3, 4));
for (Integer n : nums) {
if (n % 2 == 0) nums.remove(n); // throws ConcurrentModificationException
}
nums.removeIf(n -> n % 2 == 0); // correct: [1, 3]ArrayList's iterator is fail-fast: it notices the list changed underneath it and stops. Use removeIf() or an explicit Iterator.remove().
7. Java 8: lambdas, streams, Optional
A lambda is a short way to pass behaviour. It works wherever a functional interface (exactly one abstract method, such as Runnable, Comparator or Predicate) is expected. Streams process collections as a pipeline:
record Employee(String name, String dept, double salary) {}
List<Employee> employees = List.of(
new Employee("Asha", "Engineering", 90000),
new Employee("Ravi", "Engineering", 75000),
new Employee("Meera", "Sales", 60000));
// names of engineers earning more than 80,000
List<String> names = employees.stream()
.filter(e -> e.dept().equals("Engineering") && e.salary() > 80000)
.map(Employee::name)
.toList(); // [Asha]
// average salary per department
Map<String, Double> avgByDept = employees.stream()
.collect(Collectors.groupingBy(Employee::dept, Collectors.averagingDouble(Employee::salary)));
// {Engineering=82500.0, Sales=60000.0}
// Optional makes "maybe no result" explicit instead of returning null
Optional<Employee> top = employees.stream().max(Comparator.comparingDouble(Employee::salary));
System.out.println(top.map(Employee::name).orElse("nobody")); // Ashamap() turns each element into one new element; flatMap() turns each element into a stream and joins them:
List<List<String>> skills = List.of(List.of("java", "sql"), List.of("react"));
skills.stream().map(List::size).toList(); // [2, 1]
skills.stream().flatMap(List::stream).toList(); // [java, sql, react]Streams are lazy: nothing runs until a terminal operation such as toList(), collect() or count(). A stream can be used only once.
8. Modern Java (11 to 25)
Java ships a release every six months; Java 17, 21 and 25 are the long-term-support versions most companies use. Mentioning these features shows you're current:
var names = new ArrayList<String>(); // Java 10: local type inference
record Point(int x, int y) {} // Java 16: immutable data class
String json = """
{"name": "Asha", "role": "developer"}
"""; // Java 15: text block
String type = switch (day) { // Java 14: switch expression
case SATURDAY, SUNDAY -> "weekend";
default -> "weekday";
};
if (obj instanceof String s && !s.isBlank()) { // Java 16: pattern matching for instanceof
System.out.println(s.length());
}
sealed interface Shape permits Circle, Square {} // Java 17: sealed types
record Circle(double r) implements Shape {}
record Square(double side) implements Shape {}
double area = switch (shape) { // Java 21: pattern matching for switch
case Circle c -> Math.PI * c.r() * c.r();
case Square s -> s.side() * s.side(); // no default needed: the compiler knows every Shape
};9. Multithreading
A thread is an independent path of execution. Threads share the heap, which is both why they're useful and why they break. Here two threads each add 100,000 to a counter:
class Counter {
private int count = 0;
void increment() { count++; } // read, add, write: three steps, not atomic
int get() { return count; }
}
// Expected 200000. A real run printed: 142704 (updates were lost)
// Fix 1: synchronized - one thread at a time
synchronized void increment() { count++; } // 200000
// Fix 2: AtomicInteger - lock-free and usually faster
private final AtomicInteger count = new AtomicInteger();
void increment() { count.incrementAndGet(); } // 200000volatile is not a fix here: it makes every thread see the latest value, but count++ is still three separate steps. Use volatile for simple flags, such as a running boolean another thread reads.
Use a thread pool, not new Thread()
ExecutorService pool = Executors.newFixedThreadPool(4);
List<Future<Integer>> results = new ArrayList<>();
for (int i = 1; i <= 4; i++) {
int n = i;
results.add(pool.submit(() -> n * n)); // a Callable: returns a value
}
for (Future<Integer> f : results) {
System.out.println(f.get()); // 1 4 9 16
}
pool.shutdown();
// Java 21: virtual threads make thousands of blocking tasks cheap
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
for (int i = 0; i < 10_000; i++) {
executor.submit(() -> callSlowApi());
}
}Deadlock happens when thread A holds lock 1 and waits for lock 2, while thread B holds lock 2 and waits for lock 1. Prevent it by always taking locks in the same order, holding them briefly, or using tryLock() with a timeout.
10. Memory and garbage collection
Stack
One per thread. Method calls, local primitives and references. Freed automatically when a method returns.
Heap
Shared by all threads. Every object, including the String pool. Cleaned by the garbage collector.
Metaspace
Class metadata. Replaced PermGen in Java 8 and grows as needed.
The garbage collector frees objects nothing references anymore. Most objects die young, so the heap is split into young and old generations and the young one is collected often and cheaply. G1 is the default collector since Java 9. System.gc() is only a request; the JVM may ignore it.
Java can still leak memory: objects you no longer need but still reference. Common causes are static collections that only grow, caches without a size limit, listeners that are never removed, and unclosed resources.
11. Eight coding programs to practise
Freshers are often asked to write one of these on paper or in a plain editor. Write each one twice without looking.
// 1. Reverse a string
static String reverse(String s) {
return new StringBuilder(s).reverse().toString();
}
// reverse("java") -> "avaj"
// 2. Palindrome, ignoring case, spaces and punctuation
static boolean isPalindrome(String s) {
String clean = s.toLowerCase().replaceAll("[^a-z0-9]", "");
int i = 0, j = clean.length() - 1;
while (i < j) {
if (clean.charAt(i++) != clean.charAt(j--)) return false;
}
return true;
}
// isPalindrome("Madam, I'm Adam") -> true
// 3. First n Fibonacci numbers
static List<Long> fibonacci(int n) {
List<Long> out = new ArrayList<>();
long a = 0, b = 1;
for (int i = 0; i < n; i++) {
out.add(a);
long next = a + b;
a = b;
b = next;
}
return out;
}
// fibonacci(8) -> [0, 1, 1, 2, 3, 5, 8, 13]
// 4. Prime check: only test divisors up to the square root
static boolean isPrime(int n) {
if (n < 2) return false;
for (int i = 2; (long) i * i <= n; i++) { // long: i * i would overflow near Integer.MAX_VALUE
if (n % i == 0) return false;
}
return true;
}
// primes up to 30 -> [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
// 5. Second largest distinct number, in one pass
static OptionalInt secondLargest(int[] nums) {
Integer first = null, second = null;
for (int n : nums) {
if (first == null || n > first) { second = first; first = n; }
else if (n < first && (second == null || n > second)) second = n;
}
return second == null ? OptionalInt.empty() : OptionalInt.of(second);
}
// secondLargest({4, 9, 2, 9, 7}) -> 7 secondLargest({5, 5}) -> empty
// 6. Anagram check
static boolean isAnagram(String a, String b) {
char[] x = a.replace(" ", "").toLowerCase().toCharArray();
char[] y = b.replace(" ", "").toLowerCase().toCharArray();
Arrays.sort(x);
Arrays.sort(y);
return Arrays.equals(x, y);
}
// isAnagram("Listen", "Silent") -> true
// 7. Character frequency
static Map<Character, Integer> frequency(String s) {
Map<Character, Integer> freq = new HashMap<>();
for (char ch : s.toCharArray()) freq.merge(ch, 1, Integer::sum);
return freq;
}
// frequency("banana") -> {a=3, b=1, n=2}
// 8. Duplicates in an array, in the order they repeat
static Set<Integer> duplicates(int[] nums) {
Set<Integer> seen = new HashSet<>(), dupes = new LinkedHashSet<>();
for (int n : nums) {
if (!seen.add(n)) dupes.add(n); // add() returns false if it was already there
}
return dupes;
}
// duplicates({1, 2, 3, 2, 4, 1}) -> [2, 1]12. 30 Java interview questions with answers
OOP and core Java
Q1
What are the four pillars of OOP?
Encapsulation: keep data private and expose controlled methods. Abstraction: show what an object does, hide how. Inheritance: a class reuses and extends another class. Polymorphism: one call behaves differently depending on the object, through overloading (compile time) and overriding (runtime).
Q2
What is the difference between an abstract class and an interface?
An abstract class can have instance fields, constructors, and both abstract and concrete methods; a class can extend only one. An interface defines a contract; since Java 8 it can also have default and static methods (and private ones since Java 9), but no instance state, and a class can implement many. Use an abstract class to share code and state between related classes, an interface for a capability unrelated classes can share.
Q3
What is method overloading vs method overriding?
Overloading: same method name, different parameter lists, in the same class; the compiler picks the version (compile-time polymorphism). Overriding: a subclass redefines an inherited method with the same signature; the JVM picks the version from the object's actual type at runtime (runtime polymorphism).
Q4
What is the difference between JDK, JRE, and JVM?
The JVM executes bytecode. The JRE is the JVM plus the standard class libraries, enough to run programs. The JDK adds development tools such as the javac compiler and debugger. Since Java 11 there is no separate JRE download; you install a JDK.
Q5
Why is Java called platform independent?
javac compiles source code to bytecode, not to machine code for one OS. Each operating system has its own JVM that runs the same bytecode, so one compiled program runs anywhere a JVM exists. The JVM itself is platform-specific.
Q6
What does the static keyword mean?
A static field or method belongs to the class, not to any object: there is one copy shared by all instances, and you call it without creating an object. Static methods can't use this or instance fields directly. A static block runs once when the class is loaded.
Q7
What is the final keyword in Java?
A final variable can be assigned only once. A final method can't be overridden. A final class can't be extended, String being the best-known example. Note that a final reference to a list can't point to another list, but the list's contents can still change.
Q8
What is the difference between final, finally and finalize?
final is a keyword for constants, non-overridable methods and non-extendable classes. finally is a block that always runs after try/catch, used for cleanup. finalize() was a method the garbage collector might call before destroying an object; it is deprecated for removal and shouldn't be used. Use try-with-resources instead.
Q9
What is the difference between this and super?
this refers to the current object; this() calls another constructor of the same class. super refers to the parent class part of the object; super() calls the parent constructor and super.method() calls the parent's version of an overridden method. A constructor call with this() or super() must be the first statement.
Strings and objects
Q10
What is the difference between == and .equals()?
== compares references: whether two variables point to the same object. .equals() compares content as the class defines it. For Strings, always use .equals() or equalsIgnoreCase(); == only seems to work for literals because they share one pooled object.
Q11
What is the difference between String, StringBuilder, and StringBuffer?
String is immutable: every change creates a new object. StringBuilder is mutable and not synchronized, the right choice for building text, for example in a loop. StringBuffer is mutable and synchronized, so it is thread-safe but slower, and is rarely needed today.
Q12
Why are Strings immutable?
Security and reliability: a String used as a file path, URL or HashMap key can't be changed after it is checked. It is thread-safe without locking, its hash code can be cached, and the JVM can share one object for identical literals in the String pool.
Q13
What is the equals() and hashCode() contract?
Equal objects must return the same hash code. If you override equals(), override hashCode() using the same fields, otherwise HashMap and HashSet look in the wrong bucket and can't find objects that are equal. Unequal objects may share a hash code; that is a collision, which is allowed but slows lookups.
Q14
What is a record?
A record (Java 16) is a compact, immutable data class: record Point(int x, int y) {} generates private final fields, a constructor, accessors (x(), y()), equals(), hashCode() and toString(). Use records for data carriers such as DTOs.
Exceptions
Q15
What is the difference between checked and unchecked exceptions?
Checked exceptions (IOException, SQLException) are verified at compile time: you must catch them or declare them with throws. Unchecked exceptions extend RuntimeException (NullPointerException, IllegalArgumentException, ArrayIndexOutOfBoundsException) and don't need to be declared; they usually signal a bug or invalid input.
Q16
What is the difference between throw and throws?
throw is a statement that raises an exception object right now: throw new IllegalArgumentException(...). throws is part of a method signature that declares which checked exceptions the method can pass to its caller.
Q17
What is try-with-resources?
A try statement that declares resources (anything AutoCloseable, such as files, streams and database connections) in parentheses. Java closes them automatically when the block ends, even if an exception is thrown, which replaces error-prone finally blocks.
Collections
Q18
What is the difference between ArrayList and LinkedList?
ArrayList is backed by an array: get(i) is O(1) and adding at the end is amortized O(1), but inserting or removing in the middle is O(n) because elements shift. LinkedList is a doubly linked list: adding or removing at either end is O(1), but get(i) is O(n) because it walks the nodes. In practice ArrayList is faster for almost everything because its memory is contiguous.
Q19
How does HashMap work internally?
It keeps an array of buckets (16 by default). put() uses the key's hashCode() to choose a bucket and equals() to find the key inside it. Collisions are chained; since Java 8 a bucket with 8 or more entries becomes a red-black tree (when the table has at least 64 buckets). When the map is 75% full it doubles its capacity and redistributes entries. It allows one null key and is not thread-safe.
Q20
What is the difference between HashMap, LinkedHashMap, and TreeMap?
HashMap: no order, O(1) average operations. LinkedHashMap: keeps insertion order (or access order, useful for an LRU cache) at slightly higher memory cost. TreeMap: keeps keys sorted by natural order or a Comparator, with O(log n) operations.
Q21
HashMap vs Hashtable vs ConcurrentHashMap?
HashMap is not thread-safe and allows one null key. Hashtable is a legacy class that synchronizes every method, which makes it slow, and allows no nulls. ConcurrentHashMap is the modern thread-safe map: it locks only small parts of the table, so many threads can read and write at once, and it doesn't allow null keys or values.
Q22
What is the difference between Comparable and Comparator?
Comparable defines a class's single natural order through compareTo() inside the class, for example String's alphabetical order. Comparator is a separate object defining any order you need, passed to sort() or a TreeMap; Comparator.comparing(...).thenComparing(...) builds them easily.
Q23
What are fail-fast and fail-safe iterators?
Fail-fast iterators (ArrayList, HashMap) throw ConcurrentModificationException if the collection is structurally changed during iteration other than through the iterator. Fail-safe (weakly consistent) iterators, as in ConcurrentHashMap and CopyOnWriteArrayList, work on a snapshot or tolerate changes and never throw it.
Java 8 and multithreading
Q24
What is a functional interface?
An interface with exactly one abstract method, such as Runnable, Comparator, Predicate or Function. Lambdas and method references can be used wherever one is expected. The @FunctionalInterface annotation makes the compiler enforce the single-method rule.
Q25
What is the difference between map() and flatMap()?
map() transforms each element into exactly one new element. flatMap() transforms each element into a stream and flattens all those streams into one, for example turning a list of lists of skills into one list of skills.
Q26
Why use Optional?
To make it explicit in the method signature that a result may be absent, instead of returning null and risking a NullPointerException. Use map(), orElse() and orElseThrow() rather than calling get() without checking. Don't use Optional for fields or method parameters.
Q27
What is the difference between Thread, Runnable and Callable?
Thread is the class that runs code on a new thread. Runnable is a task with run(), which returns nothing and can't throw checked exceptions. Callable is a task with call(), which returns a value and can throw; submit it to an ExecutorService to get a Future. Prefer submitting tasks to a thread pool over creating threads directly.
Q28
What is the difference between synchronized and volatile?
synchronized gives mutual exclusion (only one thread runs the block at a time) and visibility. volatile only gives visibility: every thread reads the latest value. volatile is enough for a simple flag, but not for compound actions like count++, which need synchronized or an AtomicInteger.
Q29
What is a deadlock and how do you avoid it?
Two or more threads each hold a lock the other needs and wait forever. Avoid it by acquiring locks in a consistent global order, holding locks for as short a time as possible, using tryLock() with a timeout, or using higher-level concurrency utilities instead of manual locks.
Q30
What is the difference between heap and stack memory?
Each thread has its own stack, holding method call frames, local primitives and object references; it is freed automatically when methods return, and too-deep recursion causes StackOverflowError. The heap is shared by all threads and holds all objects; the garbage collector reclaims unreachable ones, and running out causes OutOfMemoryError.
13. A 4-week preparation plan
Core Java and OOP
JVM basics, OOP pillars with your own examples, static and final, Strings, equals and hashCode. Programs 1 to 4.
Exceptions and Collections
Checked vs unchecked, try-with-resources, List, Set, Map, HashMap internals, Comparator. Programs 5 to 8.
Java 8 and modern Java
Lambdas, streams, Collectors, Optional, records, switch expressions. Rewrite your programs with streams.
Multithreading and revision
Race conditions, synchronized, AtomicInteger, ExecutorService, heap vs stack. Answer all 30 questions out loud, then do mock interviews.
14. Interview tips
- Answer with an example. "Polymorphism is..." plus a two-line code example beats a textbook definition.
- Know HashMap and equals/hashCode cold; they come up in almost every Java round.
- When writing code, talk through it, handle edge cases, and state the time complexity.
- Mention modern Java (records, switch expressions, streams). It shows you learned recently, not from old notes.
- If you don't know an answer, say what you do know and how you'd find out. Bluffing is easy to spot.
- Connect answers to your projects: "In my library project I used a HashMap to..." is memorable.
Final thoughts
Java interviews reward understanding over memorising. If you can explain why HashMap needs both hashCode() and equals(), why count++ breaks with two threads, and write the eight programs above without help, you're ahead of most candidates. Practise saying your answers out loud with a free AI mock interview, and find Java openings on Roundexa's jobs list.
Practise your Java interview out loud
Answer real interview questions and get a score, feedback and an ideal answer for each. Free to try.
Try a free mock interviewRead Next
SQL Interview Questions and Answers for Freshers 2026
SQL questions come up in almost every technical interview. This guide covers the 10 most common ones — JOINs, GROUP BY, subqueries, indexes — with clear explanations you can actually say out loud.
TCS Interview Questions and Answers for Freshers 2026
Getting ready for a TCS interview? Here's what actually gets asked across every round — technical, managerial, and HR — with clear answers and tips from candidates who've been through it.