Java interview questions cover OOP principles, collections, concurrency, JVM internals, and design patterns. Questions range from language fundamentals to advanced topics like garbage collection, thread safety, and reactive programming with modern Java features.

Object-Oriented Programming (15)

Master the four pillars (encapsulation, inheritance, polymorphism, abstraction) and how Java implements them with classes, interfaces, and access modifiers.

easy What are the 4 pillars of OOP in Java?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy What is the difference between abstraction and encapsulation?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy What is the difference between method overloading and method overriding? Cite relevant examples.

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy What is polymorphism in Java? Explain compile-time vs runtime polymorphism.

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy What is the difference between an abstract class and an interface?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

medium Can an interface have static methods? What about default methods?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

medium What is the diamond problem in Java? How does Java 8 handle it with default methods?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

hard What is the Liskov Substitution Principle?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

medium What is the difference between composition and inheritance? Why is composition preferred?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

medium What is the difference between Composition and Aggregation?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy What is the 'IS-A' relationship in OOP Java?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy Why is Java not a pure object-oriented language?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy Can Java be said to be a complete object-oriented programming language?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy Explain data encapsulation with an example.

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

easy What are the access modifiers in Java and what is their scope?

What interviewers evaluate: Object-Oriented Programming

Expand and practise this question in an AI mock interview.

Data Types, Variables & Operators (7)

Cover Java's primitive types, autoboxing, type casting, operator precedence, and the gotchas that trip up junior developers in interviews.

easy What are the default values assigned to variables and instances in Java?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

easy What do you understand by an instance variable and a local variable?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

easy What is the default value of local variables?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

easy What are wrapper classes in Java?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

easy What is autoboxing and unboxing?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

medium What is the difference between the '>>' and '>>>' operators in Java?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

medium Why does `System.out.println('b' + 'i' + 't')` print a number?

What interviewers evaluate: Data Types, Variables & Operators

Expand and practise this question in an AI mock interview.

Strings (9)

Understand String immutability, the String pool, StringBuilder vs StringBuffer, and the performance implications of string operations in Java.

medium Why are strings immutable in Java? What are the reasons beyond the security aspect?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

medium What is the difference between String, StringBuffer, and StringBuilder?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

medium How is the creation of a String using `new()` different from that of a literal?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

medium Why is the character array preferred over String for storing confidential information?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

hard Why is it said that the `length()` method of String class doesn't return accurate results?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

easy Which should be preferred when there are lots of updates: String or StringBuffer?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

medium What is the String pool in Java?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

medium Why does `String s = "a"; s += "b";` create extra objects?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

medium Why can `==` be true for some strings and false for others?

What interviewers evaluate: Strings

Expand and practise this question in an AI mock interview.

Exceptions (11)

Learn checked vs unchecked exceptions, try-with-resources, exception hierarchy, custom exceptions, and Java's exception handling best practices.

easy What is the difference between checked and unchecked exceptions?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

easy What is the difference between the 'throw' and 'throws' keyword in Java?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

easy Do `final`, `finally`, and `finalize` keywords have the same function?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

easy A single try block and multiple catch blocks can co-exist in a Java program. Explain.

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

medium Is it possible that the 'finally' block will not be executed? If yes, list the cases.

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

medium Will the finally block be executed if `System.exit(0)` is written at the end of the try block?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

medium What happens if you call return in try and finally also has a return?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

easy Is it mandatory for a catch block to follow a try block?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

medium How does an exception propagate in the code?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

easy How do exceptions affect the program if it doesn't handle them?

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

medium Write a Java program to create and throw custom exceptions.

What interviewers evaluate: Exceptions

Expand and practise this question in an AI mock interview.

Core Language Features (25)

Cover static vs instance, final keyword, nested classes, generics, annotations, and the language features every Java developer must know.

easy Explain the use of the `final` keyword in variable, method, and class.

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy Can the main method be overloaded?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy Why is the main method static in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium Can static methods be overridden? Why or why not?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy Explain `public static void main(String args[])` in Java.

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy What is the difference between `equals()` method and equality operator `==` in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy How is Java different from C++?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy Why does Java not make use of pointers?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy What is the difference between Heap and Stack Memory in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy When can you use the `super` keyword?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy Explain the concept of constructor overloading.

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy Define copy constructor in Java.

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium Can you call a constructor of a class inside another constructor?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy What are the differences between constructor and method of a class in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium Java works as 'pass by value' or 'pass by reference'?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium What is the importance of reflection in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium What do you understand by marker interfaces in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

hard Explain the term 'Double Brace Initialization' in Java.

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium What is a singleton class in Java? How do you implement it?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium How to not allow serialization of attributes of a class in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium What do you understand by Object Cloning and how do you achieve it?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium What are shallow copy and deep copy in Java?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium What is a ClassLoader?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

medium Tell us something about JIT compiler.

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

easy What do you understand about JDK, JRE, and JVM?

What interviewers evaluate: Core Language Features

Expand and practise this question in an AI mock interview.

Collections Framework (36)

Master ArrayList, HashMap, ConcurrentHashMap, TreeMap, LinkedList, and the time complexity, thread safety, and use cases of each collection.

medium How is `HashMap` implemented internally in Java?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy What is the difference between `ArrayList` and `LinkedList`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What is the difference between `HashMap` and `HashTable`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What makes a `HashSet` different from a `TreeSet`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy What is the difference between `HashSet` and `HashMap`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy What is the difference between `ArrayList` and `Vector`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Differentiate between `List` and `Set` in Java.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Differentiate between `Set` and `Map` in Java.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium Differentiate between `Iterator` and `ListIterator` in Java.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What is the difference between `Comparable` and `Comparator`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard When should you use `ConcurrentHashMap` vs `Collections.synchronizedMap()`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard What is fail-fast vs fail-safe iterator?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Explain the hierarchy of the Collection framework in Java.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Explain the various interfaces used in the Collection framework.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Differentiate between `Collection` and `Collections` in Java.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium How do `TreeMap` and `HashMap` differ?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium Can you add a null element into a `TreeSet` or `HashSet`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium Why does `HashMap` allow one null key, but `HashTable` doesn't?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What is a priority queue in Java?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium How can you make an `ArrayList` read-only in Java?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium How can you synchronize an `ArrayList` in Java?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium Why does the `remove()` method run faster in LinkedList than in an array?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium How does the size of `ArrayList` grow dynamically? Explain the internal implementation.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium Contiguous memory locations are usually used for storing actual values in an array but not in `ArrayList`. Explain.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Why does the Java array index start with 0?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy What is the difference between an Array and a Collection in Java?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

easy Differentiate between `Array` and `ArrayList`.

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What is the default size of the load factor in hashing-based collections?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard What is `BlockingQueue`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What are some best practices while using Java Collections?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard Why doesn't the `Map` interface extend the `Collection` interface?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard What is the purpose of the `RandomAccess` interface?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What is the difference between `Iterator` and `Enumeration`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

medium What is the use of the `Properties` class in Java?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard Why do we need synchronized `ArrayList` when we have `Vector`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

hard What are the benefits of using `ConcurrentHashMap`?

What interviewers evaluate: 2. Collections Framework

Expand and practise this question in an AI mock interview.

Multithreading & Concurrency (52)

Cover threads, ExecutorService, locks, synchronized blocks, volatile, atomic classes, and how to write thread-safe code that scales.

easy What is a thread in Java? What is the difference between a thread and a process?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

easy What are the two ways of creating a thread in Java?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What are the different states of a thread in Java? Explain the thread lifecycle.

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

easy What is the difference between `Runnable` and `Thread`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the difference between `Runnable` and `Callable`? When should you use `Callable` over `Runnable`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

easy What is the difference between `start()` and `run()` method?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is synchronization in Java? Why is it necessary?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium How does the `synchronized` keyword work?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the difference between synchronized method and synchronized block? Which should be preferred?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is a deadlock? How do you prevent it?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the difference between `wait()` and `sleep()`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the purpose of `wait()`, `notify()`, and `notifyAll()`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard Why are `wait()`, `notify()`, and `notifyAll()` in the `Object` class, not the `Thread` class?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the difference between `notify()` and `notifyAll()`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the purpose of the `volatile` keyword?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the difference between the `volatile` keyword and Atomic classes?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard How does `ThreadLocal` work?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the difference between `synchronized` and `ReentrantLock`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the lock interface? Why is it preferred over synchronized blocks?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the difference between class lock and object lock?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is the difference between user thread and daemon thread?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium How can we create daemon threads?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium Can you start a thread twice?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

easy Is it possible to call the `run()` method directly to start a new thread?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is thread safety and why is it important?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What are the ways to achieve thread safety in Java?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is an atomic operation?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What are the classes in `java.util.concurrent.atomic` package?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the `ExecutorService` in Java? How is it different from using threads directly?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the difference between `execute()` and `submit()` methods in `ExecutorService`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard How do you gracefully shut down an `ExecutorService`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the difference between `shutdown()` and `shutdownNow()`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is a `Future` in Java and how is it related to `ExecutorService`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium What is a thread pool and why is it used? Explain the different types.

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard How does `ThreadPoolExecutor` work internally?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What are the core and maximum pool sizes in `ThreadPoolExecutor`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is the keep-alive time in `ThreadPoolExecutor`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is `CyclicBarrier` and `CountDownLatch`? How do they differ?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is a `Semaphore`?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is `BlockingQueue` and how is it used in producer-consumer pattern?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is thread starvation?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is livelock? How is it different from deadlock?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium Explain context switching.

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is busy spinning?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is a `ScheduledExecutorService` and how do you use it?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard Explain the producer-consumer problem and how to solve it in Java.

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard Implement a singleton class in a multithreaded environment.

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium How do threads communicate with each other?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium Explain thread priority in Java. What is the default priority?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is a shutdown hook?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

medium How do you handle exceptions in threads?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

hard What is a `Condition` in Java concurrency?

What interviewers evaluate: 3. Multithreading & Concurrency

Expand and practise this question in an AI mock interview.

Java 8+ Features (Streams, Lambdas, Optional) (27)

Master functional Java: Stream API, Collectors, lambda expressions, method references, Optional, and the modern features that define current Java code.

medium What is a lambda expression in Java? How does it relate to a functional interface?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is a functional interface (SAM interface)? Give examples.

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are the most common pre-defined functional interfaces in Java 8?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

easy What is the basic structure/syntax of a lambda expression?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is a method reference in Java 8? What does `String::valueOf` mean?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is the difference between `map()` and `flatMap()` in Streams?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are Java 8 Streams? How are they different from Collections?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are intermediate and terminal operations in Streams? Give examples.

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are the most commonly used intermediate operations?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is the difference between `findFirst()` and `findAny()`?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is an `Optional` class? How should it be used?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are the advantages of using the `Optional` class?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is the purpose of default methods in interfaces?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium Can a functional interface extend/inherit another interface?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are static methods in interfaces?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

hard What is a stateful intermediate operation? Give examples.

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

hard What is parallel stream? When should you use it?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is the feature of the new Date and Time API in Java 8?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are the important packages for the new Date and Time API?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium Explain `LocalDate`, `LocalTime`, and `LocalDateTime` APIs.

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

easy What are the significant advantages of Java 8?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

hard What is MetaSpace? How does it differ from PermGen?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What is `var` (local type inference) introduced in Java 10?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

medium What are records in Java 14+?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

hard What are sealed classes in Java 17?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

hard What are virtual threads in Java 21? How do they differ from platform threads?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

hard What is pattern matching for switch in modern Java?

What interviewers evaluate: 4. Java 8+ Features (Streams, Lambdas, Optional)

Expand and practise this question in an AI mock interview.

JVM Architecture & Memory Model (10)

Understand heap vs stack, classloaders, JIT compilation, the Java memory model, and how the JVM executes your code under the hood.

easy What is the difference between Heap and Stack memory in Java?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

hard Explain the Java memory model.

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

hard What is PermGen vs Metaspace?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

medium What is a ClassLoader in Java?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

medium What is the JIT compiler?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

easy What are the differences between JVM, JRE, and JDK?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

easy Where do objects get created in Java?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

easy What part of memory (Stack or Heap) is cleaned in the garbage collection process?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

hard What is Eden and Survivor space in the heap?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

hard What are the different regions the heap is divided into for GC?

What interviewers evaluate: JVM Architecture & Memory Model

Expand and practise this question in an AI mock interview.

Garbage Collection (17)

Cover G1, ZGC, Shenandoah, generational GC, and how to read GC logs, tune heap parameters, and diagnose memory issues in production.

easy What is garbage collection in Java? What is its main objective?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

medium When does an object become eligible for garbage collection?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

medium Can you force garbage collection in Java?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

medium What is the difference between `System.gc()` and `Runtime.gc()`?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard What is the difference between minor and major garbage collection?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard How does the G1 Garbage Collector work?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard How does G1GC differ from CMS?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard What is the difference between Serial and Parallel Garbage Collector?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard What is the difference between ParNew and DefNew garbage collectors?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard What are the different kinds of garbage collectors available in Java?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard How do you monitor garbage collection activities?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard How do you enable garbage collection logs?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard Have you done any garbage collection tuning? What was your approach?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

medium How do you increase heap memory in Java?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

medium What are the best practices to help the garbage collector?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

hard Does garbage collection occur in the permanent generation space?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

medium What is the `finalize()` method? Can you call it directly?

What interviewers evaluate: Garbage Collection

Expand and practise this question in an AI mock interview.

Memory Leaks & Troubleshooting (8)

Learn how to find and fix Java memory leaks using heap dumps, profilers, and the common patterns that cause OutOfMemoryError in production.

hard What is a memory leak in Java? Discuss common causes.

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

hard How can you detect and fix memory leaks?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

hard Is exceeding the memory limit possible despite having a garbage collector?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

medium What are the possible ways to make an object eligible for GC?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

hard What are strong vs weak references?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

hard What is `OutOfMemoryError`? What are its 3 most likely causes?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

medium How do you find how much memory is used and total memory in Java?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

hard A thread has a lock on it; calling `sleep()` on that thread will release the lock?

What interviewers evaluate: Memory Leaks & Troubleshooting

Expand and practise this question in an AI mock interview.

Core Spring Concepts (12)

Cover Inversion of Control, dependency injection, beans, ApplicationContext, and the core Spring concepts that every Java backend developer must know.

medium What are the advantages of using Spring Boot over Spring?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

hard How does Spring Boot auto-configuration work?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium What does the `@SpringBootApplication` annotation do internally?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium What is an IOC container?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium What is dependency injection? What is the best way to inject dependency?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium What is the difference between `@Component`, `@Service`, and `@Repository`?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

hard How does Spring manage bean lifecycle?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium How do you set the Spring bean scope? What supported scopes does it have?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium What is the difference between `@Bean` and `@Component`?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

medium What is `@Configuration` and what problem does it solve?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

hard What is the role of `@ConditionalOnProperty`?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

hard How do you handle circular dependencies in Spring?

What interviewers evaluate: Core Spring Concepts

Expand and practise this question in an AI mock interview.

REST APIs & Web (6)

Build production REST APIs in Java covering @RestController, request mapping, validation, exception handling, and HTTP status codes.

medium What is the difference between `@RestController` and `@Controller`?

What interviewers evaluate: REST APIs & Web

Expand and practise this question in an AI mock interview.

medium What is the difference between `@RequestMapping` and `@GetMapping`?

What interviewers evaluate: REST APIs & Web

Expand and practise this question in an AI mock interview.

medium What is the difference between `@RequestParam`, `@PathVariable`, and `@RequestBody`?

What interviewers evaluate: REST APIs & Web

Expand and practise this question in an AI mock interview.

hard Describe the flow of HTTPS requests through a Spring Boot application.

What interviewers evaluate: REST APIs & Web

Expand and practise this question in an AI mock interview.

medium How do you design a REST API in Spring Boot (high level)?

What interviewers evaluate: REST APIs & Web

Expand and practise this question in an AI mock interview.

hard How do you version APIs without breaking clients?

What interviewers evaluate: REST APIs & Web

Expand and practise this question in an AI mock interview.

Spring Boot Operations (8)

Learn Spring Boot Actuator, Profiles, externalized configuration, embedded servers, and the operational concerns of running Spring Boot in production.

medium What is Spring Actuator? What are its advantages?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

medium What are the actuator-provided endpoints for monitoring?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

medium What is the use of Profiles in Spring Boot?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

easy Where do we define properties in a Spring Boot application?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

hard What is the difference between `application.properties` and `bootstrap.properties`?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

medium Can we override or replace the embedded Tomcat server?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

easy What is the default port of Tomcat in Spring Boot?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

easy What are starter dependencies?

What interviewers evaluate: Spring Boot Operations

Expand and practise this question in an AI mock interview.

Spring Boot Tricky Questions (5)

Tackle the gotchas that catch experienced developers: @Transactional pitfalls, lazy initialization, circular dependencies, and N+1 queries.

hard Why does `@Transactional` sometimes not work in Spring Boot?

What interviewers evaluate: Spring Boot Tricky Questions

Expand and practise this question in an AI mock interview.

hard What causes `LazyInitializationException` in Spring Boot?

What interviewers evaluate: Spring Boot Tricky Questions

Expand and practise this question in an AI mock interview.

hard Why is `spring.jpa.hibernate.ddl-auto=update` not recommended in production?

What interviewers evaluate: Spring Boot Tricky Questions

Expand and practise this question in an AI mock interview.

hard Why does field injection cause testing and immutability issues?

What interviewers evaluate: Spring Boot Tricky Questions

Expand and practise this question in an AI mock interview.

hard What causes N+1 queries in Hibernate and how do you fix it?

What interviewers evaluate: Spring Boot Tricky Questions

Expand and practise this question in an AI mock interview.

Security & Microservices (11)

Cover Spring Security, JWT, OAuth2, RBAC, inter-service communication, resilience patterns, and the challenges of distributed Java systems.

hard How do you secure REST endpoints in Spring?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard What is the difference between OAuth2 and JWT?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard How do you implement RBAC in Spring Security?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard How do you implement inter-service communication in microservices?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard How do you implement retry, fallback, and circuit breaker?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard What is the role of API Gateway in microservice architecture?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard What is the Saga pattern and when should you use it?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard How do you handle data consistency in distributed transactions?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard What is Spring Cloud Config Server?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard How do you implement distributed tracing?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

hard How do you achieve zero-downtime deployment?

What interviewers evaluate: Security & Microservices

Expand and practise this question in an AI mock interview.

Design Patterns in Java (20)

Master Singleton, Factory, Strategy, Observer, Builder, and the Java-specific implementations of GoF patterns interviewers expect you to know.

medium What are the different categories of Java design patterns (creational, structural, behavioral)?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium What is the Singleton pattern? How do you implement it in Java (including thread-safe versions)?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium How is the Factory pattern different from Abstract Factory?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium What is the Strategy pattern? Give a real-world use case.

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium Where is the Builder pattern commonly used? Why?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium What is the Observer pattern?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard Explain the Proxy pattern with real-world usage.

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard What is the difference between the Adapter and Decorator pattern?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard What is the Template Method pattern?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard When do you use the Command pattern?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard What is the benefit of Chain of Responsibility?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium What is Dependency Injection? How does Spring use it?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

medium How is MVC implemented in Spring?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard What is AOP (Aspect-Oriented Programming)? Common use cases?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard How is Lazy Initialization useful in design patterns?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard Can patterns introduce unnecessary complexity? How do you balance it?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard What is the Mediator pattern?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard Give an example of the Flyweight pattern in Java APIs.

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard What pattern does Java's Enum Singleton use?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

hard How do you test code that uses Factory or Strategy pattern?

What interviewers evaluate: 7. Design Patterns in Java

Expand and practise this question in an AI mock interview.

String & Array Manipulation (6)

Practice the coding problems that test fundamentals: palindromes, anagrams, two-pointer, sliding window, and array manipulation techniques.

easy Check if a given string is a palindrome using recursion.

What interviewers evaluate: String & Array Manipulation

Expand and practise this question in an AI mock interview.

easy Write a Java program to reverse a string.

What interviewers evaluate: String & Array Manipulation

Expand and practise this question in an AI mock interview.

easy Write a Java program to check if two strings are anagrams.

What interviewers evaluate: String & Array Manipulation

Expand and practise this question in an AI mock interview.

medium Given an array of non-duplicating numbers from 1 to n where one number is missing, find the missing number.

What interviewers evaluate: String & Array Manipulation

Expand and practise this question in an AI mock interview.

medium Write a Java program to rotate arrays 90 degrees clockwise by taking matrices from user input.

What interviewers evaluate: String & Array Manipulation

Expand and practise this question in an AI mock interview.

medium How do you find the intersection of two arrays?

What interviewers evaluate: String & Array Manipulation

Expand and practise this question in an AI mock interview.

Recursion & Algorithms (6)

Cover Fibonacci, factorial, binary search, DFS, BFS, divide and conquer, and the recursive patterns that show up in Java coding interviews.

easy Write a Java program to print the Fibonacci series using recursion.

What interviewers evaluate: Recursion & Algorithms

Expand and practise this question in an AI mock interview.

easy Write a Java program to find the factorial of a given number.

What interviewers evaluate: Recursion & Algorithms

Expand and practise this question in an AI mock interview.

medium Implement Binary Search in Java using recursion.

What interviewers evaluate: Recursion & Algorithms

Expand and practise this question in an AI mock interview.

medium Write a Java program for solving the Tower of Hanoi problem.

What interviewers evaluate: Recursion & Algorithms

Expand and practise this question in an AI mock interview.

medium Write a Java program to check if a number is the sum of 2 prime numbers.

What interviewers evaluate: Recursion & Algorithms

Expand and practise this question in an AI mock interview.

easy Check if any number is a magic number or not.

What interviewers evaluate: Recursion & Algorithms

Expand and practise this question in an AI mock interview.

Data Structures (9)

Implement and analyze LinkedList reversal, LRU cache, binary trees, heaps, tries, and the data structures every Java engineer should know.

medium How do you reverse a LinkedList without using extra space?

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

hard Implement an LRU cache in Java.

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

medium What is the time complexity of `HashMap` operations (get, put, remove)?

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

easy Explain binary search algorithm and its time complexity.

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

medium How does QuickSort work? Implement it in Java.

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

medium What is the difference between BFS and DFS?

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

medium When is a heap used in Java?

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

hard What is a Trie? Give a use case.

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

hard How do you detect a cycle in a graph?

What interviewers evaluate: Data Structures

Expand and practise this question in an AI mock interview.

Java-Specific Coding (4)

Solve coding problems using Java's specific features: custom exceptions, producer-consumer with BlockingQueue, thread-safe Singleton, and memoization.

hard Implement the producer-consumer problem using `BlockingQueue`.

What interviewers evaluate: Java-Specific Coding

Expand and practise this question in an AI mock interview.

hard Implement a thread-safe Singleton.

What interviewers evaluate: Java-Specific Coding

Expand and practise this question in an AI mock interview.

hard What is dynamic programming? Solve a DP problem in Java.

What interviewers evaluate: Java-Specific Coding

Expand and practise this question in an AI mock interview.

hard What is memoization? Implement it in Java.

What interviewers evaluate: Java-Specific Coding

Expand and practise this question in an AI mock interview.

Scenario-Based & System Design Questions (10)

Debug real production scenarios: slow apps, intermittent timeouts, OOM errors, concurrency bugs, and the systematic approach to troubleshooting Java systems.

hard Your app is slow after running for 2 hours. What do you check first?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard An API is timing out intermittently. How do you debug it?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard You see `OutOfMemoryError`. What are the 3 most likely causes?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard Multiple users update the same record simultaneously. How do you avoid wrong data?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard A background job runs twice. How do you prevent duplicates?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard You must handle 100,000 requests per minute. What changes in code or design?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard A thread is stuck. How do you identify why?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

medium You need to release resources reliably. What pattern do you use?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard How do you approach debugging a production issue end-to-end?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

hard What testing mix do you typically aim for in full-stack work (unit, integration, e2e)?

What interviewers evaluate: 9. Scenario-Based & System Design Questions

Expand and practise this question in an AI mock interview.

Database & SQL (Java Context) (11)

Cover JOINs, normalization, indexing, ACID, isolation levels, JPA optimization, and the SQL knowledge expected of senior Java developers.

easy What is the difference between INNER JOIN and LEFT JOIN?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

easy What is database normalization?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

medium How do you prevent SQL injection in Java?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

medium What is indexing and how does it work?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

medium What is ACID in databases?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

hard Explain database isolation levels.

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

medium How are transactions managed in Spring?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

hard What is optimistic vs pessimistic locking?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

medium When should you use NoSQL over RDBMS?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

hard What is the use of `JOIN FETCH` in JPQL?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

hard How do you profile slow queries?

What interviewers evaluate: 10. Database & SQL (Java Context)

Expand and practise this question in an AI mock interview.

Top 15 Recommended Questions (9)

Start here. The 15 highest-impact Java interview questions covering HashMap internals, deadlocks, Streams, GC, Spring, and more.

medium How is HashMap implemented internally in Java?

What interviewers evaluate: Collections

Expand and practise this question in an AI mock interview.

medium Why are Strings immutable in Java?

What interviewers evaluate: Core Java

Expand and practise this question in an AI mock interview.

medium Explain the Java thread lifecycle and its states.

What interviewers evaluate: Concurrency

Expand and practise this question in an AI mock interview.

medium What is the Singleton pattern? Implement a thread-safe version.

What interviewers evaluate: Design Patterns

Expand and practise this question in an AI mock interview.

hard What is garbage collection? Name the different collectors and when to use each.

What interviewers evaluate: JVM

Expand and practise this question in an AI mock interview.

easy What is the difference between ArrayList and LinkedList?

What interviewers evaluate: Collections

Expand and practise this question in an AI mock interview.

medium What is the difference between Runnable and Callable?

What interviewers evaluate: Concurrency

Expand and practise this question in an AI mock interview.

medium What is a functional interface? Give examples.

What interviewers evaluate: Java 8+

Expand and practise this question in an AI mock interview.

hard What is a memory leak in Java? How do you detect and fix it?

What interviewers evaluate: JVM

Expand and practise this question in an AI mock interview.