Java Theory Questions
30 May 2025
15:52
1. Core Java
a. Class Loaders.
b. JDK, JRE & JVM.
c. JIT compiler
d. Memory management in java.
e. What to do if there is memory leakage?
f. OOPS
g. Real life examples for each OOPS
h. SOLID Principles with examples
i. Pass by value vs Pass by Reference
j. Inheritence vs Composition
k. Constructor overloading and overriding
l. Abstract Class vs Interface
m. Design Patterns
n. Write an immutable class
o. Why Strings are immutable?
p. Garbage Collection
q. Static keyword in java.
r. Final, finally and finalize.
s. Serialization & Externalization
t. Transient keyword.
u. Optional Class
v. Java Reflection API
w. Serialization and Externalization
x. Cloning (Shallow vs Deep Cloning)
y. Marker Interface
2. Exceptions
a. Exception vs Error
b. Checked and Unchecked Exceptions
c. Throw vs throws
d. What happens if exception is thrown inside finally block?
e. Try with resources
3. Multithreading
a. Thread Lifecycle
b. Thread class vs Runnable Interface
c. Runnable vs Callable
d. Race condition
e. Deadlock
f. Threadpool
g. Executors
h. Futures
i. CompletableFutures(Async call).
4. Collections
a. ArrayList vs LinkedList
b. Sets
Interview Preparation Page 1
b.
c.
d.
e.
f.
g.
h.
i.
Sets
Hashmap vs Treemap
How Hashmap works internally?
Hash Collision.
hashCode() vs equals()
Comparable vs Comparator
Concurrent Hashmap, CopyOnWriteArraylist.
Fail Fast vs Fail Safe
5. Streams
a. Functional Interface
b. Method Reference
c. Streams in java
d. Intermediate & Terminal Operations
e. Parallel Streams
f. Predicate, Function, Consumer & Supplier
g. Map() vs FlatMap()
6. Features
a. Java 8
i. Functional Interface
ii. Lambda Expression
iii. Stream API
iv. Completable Futures
b. Java 17
i. Sealed Classes
ii. Memory API
Interview Preparation Page 2