What are some commonly asked Java, Spring Boot, and MySQL interview questions?

For a 5-year experienced developer, interview preparation for Spring Boot and related technologies should focus on both core concepts and practical implementation. Below are key areas and example questions:

Java:

  • Explain the difference between HashMap and ConcurrentHashMap.
  • How does the JVM manage memory (Heap vs Stack)?
  • What are functional interfaces and how do you use Streams in Java 8?

Spring Boot:

  • What are Spring Boot starters and how do they simplify configuration?
  • How do you handle exception handling in REST APIs using @ControllerAdvice?
  • What’s the difference between @Component, @Service, and @Repository?
  • How do you implement security with Spring Security and JWT?

Hibernate & JPA:

  • Difference between Session and EntityManager.
  • What are the common fetch types and cascade types in JPA?
  • How do you handle lazy loading and N+1 query problems?

MySQL:

  • Explain normalization and indexing.
  • What’s the difference between INNER JOIN, LEFT JOIN, and RIGHT JOIN?
  • How do you optimize slow SQL queries?

Preparation Strategy:

  • Revise core Java fundamentals first.
  • Build a small Spring Boot REST project integrating Hibernate & MySQL.
  • Focus on real-world scenarios, debugging, and performance tuning.
  • Review Spring annotations and transaction management concepts.
  • Practice SQL queries, joins, and indexing strategies.

From my experience, interviewers for mid-level roles (around 5 years) go beyond theory. They’ll ask how you used Spring Boot, JPA, or MySQL to solve actual problems.

I’d recommend revisiting a project you’ve worked on and be ready to explain things like how you managed transactions, optimized queries, or handled exceptions with @ControllerAdvice.

I also practiced a lot of SQL joins and debugging lazy loading issues in Hibernate - those always come up!

You can also explore more Spring Boot interview questions and answers.