Java Backend Developer Interview Questions and Answers
### Core Java Basics
1. What is Java?
Java is a high-level, object-oriented programming language known for its platform independence
and robustness.
2. What are the key features of Java?
- Object-oriented
- Platform-independent (Write Once, Run Anywhere)
- Automatic memory management (Garbage Collection)
- Multithreading support
- Rich API and vast libraries
3. What is the difference between JDK, JRE, and JVM?
- JDK (Java Development Kit): Includes JRE and development tools.
- JRE (Java Runtime Environment): Provides libraries and JVM to run Java applications.
- JVM (Java Virtual Machine): Executes Java bytecode.
### OOP and Core Java Concepts
4. What are the four pillars of Object-Oriented Programming (OOP) in Java?
- Encapsulation (Data hiding using private variables and public methods)
- Abstraction (Hiding implementation details using interfaces and abstract classes)
- Inheritance (Acquiring properties of a parent class)
- Polymorphism (Method overloading and overriding)
5. What is the difference between method overloading and method overriding?
- Method Overloading: Multiple methods with the same name but different parameters
(compile-time polymorphism).
- Method Overriding: A subclass redefines a method from the parent class (runtime
polymorphism).
6. What are functional interfaces and lambda expressions in Java?
A functional interface is an interface with only one abstract method, commonly used with lambda
expressions.