What is the difference between Spring and Spring Boot?

Why Interviewers Ask This

Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Spring Boot basics — a prerequisite for any developer role.

Answer

Spring Framework is a comprehensive, powerful Java application framework for dependency injection, AOP, data access, MVC, etc. It requires significant manual configuration: XML files or Java config classes for every component, dependency management (ensuring compatible versions), web server setup (external Tomcat), and component scanning configuration. Spring Boot builds on top of Spring Framework and dramatically simplifies setup: (1) Auto-configuration: Spring Boot auto-configures application based on classpath. Add spring-boot-starter-web → auto-configures DispatcherServlet, Jackson, Tomcat. No manual configuration needed; (2) Opinionated defaults: provides sensible defaults for everything; (3) Starter POMs: single dependency bundles all related libraries with compatible versions; (4) Embedded server: Tomcat embedded — just run a main class; (5) No XML: annotation-based configuration is standard. What Spring Boot does NOT change: Spring Boot IS Spring under the hood — all Spring Framework features (DI, AOP, Spring Data, Spring Security, Spring MVC) are used as-is. Spring Boot just reduces the setup friction. Analogy: Spring is a powerful engine; Spring Boot is the ready-to-drive car built on that engine — you can still access and modify the engine, but most things just work out of the box.

Pro Tip

This topic has Spring Boot-specific nuances that differ from general programming. Highlighting those nuances in your answer shows expertise rather than generic knowledge.