1. How does HashMap work internally?
Why they ask: The single most asked Java question.
How to answer: Array of buckets, hashCode decides the bucket, equals resolves collisions; since Java 8 long chains become balanced trees. Mention load factor 0.75.
2. What is the difference between == and equals()?
Why they ask: Basic but frequently fumbled.
How to answer: == compares references; equals() compares content when overridden. Cover String pool behaviour.
3. Explain the Spring Boot request flow for a REST API.
Why they ask: Checks you understand what the framework does for you.
How to answer: DispatcherServlet → controller → service → repository → database, with JSON serialisation by Jackson on the way out.
4. What is the difference between checked and unchecked exceptions?
Why they ask: Tests error-handling design.
How to answer: Checked must be declared or handled at compile time (IOException); unchecked extend RuntimeException (NullPointerException).
5. How would you make a class immutable?
Why they ask: Common in both fresher and lateral rounds.
How to answer: Final class, private final fields, no setters, defensive copies of mutable fields in constructor and getters.