Chaturmind
LearnDSASystem DesignInterview PrepDevOpsEngineering GrowthBlog
Start learning
Chaturmind

Structured learning paths for engineers who want to go deep. Written by practitioners.

Learn

  • Java
  • DSA
  • System Design
  • Spring Boot
  • AI / ML
  • DevOps
  • Engineering Growth
  • Java Interview Prep

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Chaturmind. All rights reserved.

👥10,016visitors

Built for engineers who want to go deep.


← Java Interview Prep: Fresher to 2 Years

Java Basics, JVM & Memory

  • JDK, JRE, JVM & the main Method — Interview Questions
  • JVM Memory & Garbage Collection — Interview Questions
  • Data Types, Wrapper Classes & Equality — Interview Questions

Object-Oriented Programming

  • Classes, Objects, Packages & Access Modifiers — Interview Questions
  • Inheritance, Composition, this & super — Interview Questions
  • Polymorphism, Overloading & Overriding — Interview Questions
  • Abstraction, Interfaces & Encapsulation — Interview Questions
  • Constructors, Singleton, Anonymous Classes & Immutability — Interview Questions
  • Design Patterns & SOLID Basics — Interview Questions

Strings, Keywords, Exceptions & Serialization

  • Strings, String Pool, StringBuilder & StringBuffer — Interview Questions
  • static & final Keywords — Interview Questions
  • Exceptions, Generics, Enums & Reflection — Interview Questions
  • Serialization & transient — Interview Questions

Collections Framework

  • Collections Framework Basics — Interview Questions
  • HashMap, HashSet & TreeMap Internals — Interview Questions

Multithreading Basics

  • Threads, Synchronization & volatile Basics — Interview Questions

Java 8+ & Stream API

  • Java 8 to Java 21 Features — Interview Questions
  • Stream API Coding Questions (Part 1) — Interview Questions
  • Stream API Coding Questions (Part 2) — Interview Questions

Coding Round Programs

  • Classic Number & String Programs — Interview Questions
  • String & Collection Programs — Interview Questions
  • Array & String Problem Solving — Interview Questions

Spring Framework Core

  • Spring IoC, Dependency Injection & Beans — Interview Questions
  • Spring Injection Types, Scopes, Profiles & WebFlux — Interview Questions

Spring Boot Essentials

  • Spring Boot Fundamentals — Interview Questions
  • Spring Boot Runners, Servers & Configuration — Interview Questions
  • Spring Boot Controllers, Profiles, Actuator & DevTools — Interview Questions
  • Spring Boot Testing, Exceptions & Auto-Configuration — Interview Questions
  • REST APIs, Swagger, Embedded Servers & Key Annotations — Interview Questions

Spring MVC

  • Spring MVC Architecture & DispatcherServlet — Interview Questions
  • Spring MVC Request Mapping & Controllers — Interview Questions
  • Spring MVC Forms, Views & Interceptors — Interview Questions
  • Spring MVC Exceptions, Security & Dependency Injection — Interview Questions
  • Spring MVC Data Binding, Static Resources & Path Variables — Interview Questions
  • Spring MVC i18n, Testing, File Uploads & Scaling — Interview Questions

Hibernate & Spring Data JPA

  • Hibernate & JPA Core Concepts — Interview Questions
  • Hibernate Performance, Mapping & Scenarios — Interview Questions

SQL

  • SQL Basics, Keys, Normalization & Transactions — Interview Questions
  • SQL Joins, Triggers, Procedures, Functions & Indexes — Interview Questions
  • SQL "Difference Between" Questions — Interview Questions
  • SQL Query Writing (Part 1) — Interview Questions
  • SQL Query Writing (Part 2) — Interview Questions

Microservices Basics

  • Microservices, API Gateway & Communication — Interview Questions
  • Service Discovery, Data Consistency & Deployment — Interview Questions
  • Microservices Monitoring, Security & Resilience — Interview Questions

Maven & Git

  • Maven — Interview Questions
  • Git — Interview Questions
Chaturmind
← Java Interview Prep: Fresher to 2 Years

Java Basics, JVM & Memory

  • JDK, JRE, JVM & the main Method — Interview Questions
  • JVM Memory & Garbage Collection — Interview Questions
  • Data Types, Wrapper Classes & Equality — Interview Questions

Object-Oriented Programming

  • Classes, Objects, Packages & Access Modifiers — Interview Questions
  • Inheritance, Composition, this & super — Interview Questions
  • Polymorphism, Overloading & Overriding — Interview Questions
  • Abstraction, Interfaces & Encapsulation — Interview Questions
  • Constructors, Singleton, Anonymous Classes & Immutability — Interview Questions
  • Design Patterns & SOLID Basics — Interview Questions

Strings, Keywords, Exceptions & Serialization

  • Strings, String Pool, StringBuilder & StringBuffer — Interview Questions
  • static & final Keywords — Interview Questions
  • Exceptions, Generics, Enums & Reflection — Interview Questions
  • Serialization & transient — Interview Questions

Collections Framework

  • Collections Framework Basics — Interview Questions
  • HashMap, HashSet & TreeMap Internals — Interview Questions

Multithreading Basics

  • Threads, Synchronization & volatile Basics — Interview Questions

Java 8+ & Stream API

  • Java 8 to Java 21 Features — Interview Questions
  • Stream API Coding Questions (Part 1) — Interview Questions
  • Stream API Coding Questions (Part 2) — Interview Questions

Coding Round Programs

  • Classic Number & String Programs — Interview Questions
  • String & Collection Programs — Interview Questions
  • Array & String Problem Solving — Interview Questions

Spring Framework Core

  • Spring IoC, Dependency Injection & Beans — Interview Questions
  • Spring Injection Types, Scopes, Profiles & WebFlux — Interview Questions

Spring Boot Essentials

  • Spring Boot Fundamentals — Interview Questions
  • Spring Boot Runners, Servers & Configuration — Interview Questions
  • Spring Boot Controllers, Profiles, Actuator & DevTools — Interview Questions
  • Spring Boot Testing, Exceptions & Auto-Configuration — Interview Questions
  • REST APIs, Swagger, Embedded Servers & Key Annotations — Interview Questions

Spring MVC

  • Spring MVC Architecture & DispatcherServlet — Interview Questions
  • Spring MVC Request Mapping & Controllers — Interview Questions
  • Spring MVC Forms, Views & Interceptors — Interview Questions
  • Spring MVC Exceptions, Security & Dependency Injection — Interview Questions
  • Spring MVC Data Binding, Static Resources & Path Variables — Interview Questions
  • Spring MVC i18n, Testing, File Uploads & Scaling — Interview Questions

Hibernate & Spring Data JPA

  • Hibernate & JPA Core Concepts — Interview Questions
  • Hibernate Performance, Mapping & Scenarios — Interview Questions

SQL

  • SQL Basics, Keys, Normalization & Transactions — Interview Questions
  • SQL Joins, Triggers, Procedures, Functions & Indexes — Interview Questions
  • SQL "Difference Between" Questions — Interview Questions
  • SQL Query Writing (Part 1) — Interview Questions
  • SQL Query Writing (Part 2) — Interview Questions

Microservices Basics

  • Microservices, API Gateway & Communication — Interview Questions
  • Service Discovery, Data Consistency & Deployment — Interview Questions
  • Microservices Monitoring, Security & Resilience — Interview Questions

Maven & Git

  • Maven — Interview Questions
  • Git — Interview Questions
HomeLearnJava Interview PrepJava Interview Prep: Fresher to 2 YearsSpring Boot Essentials
✓ FreeBeginner· 7 min read

Spring Boot Fundamentals — Interview Questions

What Spring Boot is, its features, advantages and key components, why teams prefer it over plain Spring, how it works internally, starters, application startup, @SpringBootApplication, Spring Initializr, beans and autowiring.

Published September 25, 2026


How to use this lesson

Spring Boot questions for freshers circle around one idea: auto-configuration. If you can explain how Boot decides what to configure (starters on the classpath → conditional auto-configuration classes → beans), most of these questions answer themselves.

Q1. What is Spring Boot?

Short answer: Spring Boot is an opinionated extension of the Spring Framework for building production-ready, standalone applications with minimal setup. It auto-configures beans based on what's on the classpath, bundles an embedded server, so the app runs as java -jar app.jar, and adds production features such as health checks and metrics.

Key points to cover:

  • It's ideal for microservices and REST APIs: one executable artifact per service, configured through properties and environment variables.
  • Spring Boot 3.x is built on Spring Framework 6, requires Java 17+, and uses Jakarta EE (jakarta.*) namespaces.

Learn it in depth → What Is Spring Boot

Q2. What are the features of Spring Boot?

Short answer:

  • Auto-configuration.
  • Starter dependencies.
  • Embedded servers: Tomcat (the default), Jetty or Undertow.
  • Externalised configuration: properties, YAML, environment variables, profiles.
  • Actuator: health, metrics, info, and other operational endpoints.
  • DevTools: automatic restarts in development.
  • Testing support: @SpringBootTest and test slices.
  • Cloud readiness: container images, graceful shutdown, liveness and readiness probes.

Q3. What are the advantages of Spring Boot?

Short answer:

  • Much less configuration.
  • Faster project setup.
  • Consistent dependency versions.
  • Simple deployment, as one runnable JAR.
  • Production monitoring out of the box.
  • Smooth integration with the rest of the Spring ecosystem (Data, Security, Cloud, Kafka).

Key points to cover:

  • A trade-off worth mentioning: auto-configuration can feel like "magic". You need to know how to inspect it (the --debug condition report, or the /actuator/conditions endpoint) when something is configured unexpectedly.

Q4. What are the key components of Spring Boot?

Short answer:

  1. Starters: curated dependency bundles.
  2. Auto-configuration: conditional @Configuration classes.
  3. SpringApplication: the bootstrap class that creates the context and starts the server.
  4. Externalised configuration (application.yml, @ConfigurationProperties).
  5. Actuator: operational endpoints.
  6. The Spring Boot CLI and the build plugins (Maven/Gradle), which package executable JARs and container images.

Q5. Why is Spring Boot preferred over plain Spring?

Short answer: With plain Spring, you choose and align library versions, configure the DispatcherServlet, data sources, transaction managers and JSON converters yourself, and deploy a WAR file to an external server. Boot does all of that from sensible defaults, and still lets you override any part.

TaskPlain SpringSpring Boot
Web setupConfigure DispatcherServlet, message convertersAdd spring-boot-starter-web
DataSource + JPADefine DataSource, EntityManagerFactory, TransactionManager beansSet spring.datasource.url; beans are auto-configured
RunBuild a WAR, install Tomcat, deployjava -jar app.jar

Learn it in depth → Auto-Configuration Mechanism

Q6. How does Spring Boot work internally?

Short answer: SpringApplication.run() does the following:

  1. Creates the ApplicationContext.
  2. Loads configuration from properties, environment variables and profiles.
  3. Runs component scanning.
  4. Imports the auto-configuration classes listed in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. Each one is guarded by conditions such as:
    • @ConditionalOnClass: is Tomcat or Hibernate on the classpath?
    • @ConditionalOnMissingBean: has the user already defined this bean?
    • @ConditionalOnProperty.
  5. Creates the beans.
  6. Starts the embedded web server.
@AutoConfiguration
@ConditionalOnClass(DataSource.class)
class SimplifiedDataSourceAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean                 // backs off if you defined your own DataSource
    DataSource dataSource(DataSourceProperties props) { return props.initializeDataSourceBuilder().build(); }
}

Key points to cover:

  • "Back off" is the key design idea. Your own beans always win over the auto-configured defaults.
  • Before Boot 2.7, auto-configurations were listed in spring.factories.

Learn it in depth → Auto-Configuration Mechanism

Q7. What are Spring Boot starter dependencies?

Short answer: Starters are dependency descriptors that pull in a tested, compatible set of libraries for a feature, and trigger the matching auto-configuration. Examples:

  • spring-boot-starter-web: Spring MVC, embedded Tomcat, Jackson.
  • spring-boot-starter-data-jpa: Hibernate, Spring Data JPA, HikariCP.
  • spring-boot-starter-security.
  • spring-boot-starter-test: JUnit 5, Mockito, AssertJ, Spring Test.
  • spring-boot-starter-actuator.

Key points to cover:

  • You don't specify versions for managed libraries. The Spring Boot parent or BOM supplies them.

Q8. How does a Spring Boot application start?

Short answer: The main method calls SpringApplication.run(App.class, args). That:

  1. Prepares the environment (properties, profiles).
  2. Prints the banner.
  3. Creates the right type of ApplicationContext (servlet, reactive or none).
  4. Loads the bean definitions (scanning plus auto-configuration).
  5. Refreshes the context, which instantiates the singletons.
  6. Starts the embedded server.
  7. Runs any CommandLineRunner/ApplicationRunner beans.
  8. Publishes ApplicationReadyEvent.
@SpringBootApplication
public class ShopApplication {
    public static void main(String[] args) {
        SpringApplication.run(ShopApplication.class, args);
    }
}

Q9. What does @SpringBootApplication do internally?

Short answer: It's a shortcut for three annotations:

  • @SpringBootConfiguration: a specialised @Configuration.
  • @EnableAutoConfiguration: imports the conditional auto-configuration classes.
  • @ComponentScan: scans the annotated class's package and its sub-packages.

Common trap: putting the main class in a sub-package, such as com.shop.app, while your components live in com.shop.orders. They're outside the scan, so they're never found. Keep the main class in the root package.

Q10. What is Spring Initializr?

Short answer: A project generator, at start.spring.io, which is also built into IntelliJ, VS Code and the Spring CLI. You pick the build tool, language, Boot version, Java version and dependencies, and it generates a ready-to-run project skeleton with the correct parent POM or plugins, the main class, and a test.

Q11. What is a Spring bean (in a Boot application)?

Short answer: An object created and managed by the Spring container, with its dependencies injected and its lifecycle handled by Spring. In Boot, beans come from component scanning (@Component, @Service, @Repository, @RestController), your @Bean methods, and auto-configuration (the DataSource, ObjectMapper, RestClient.Builder, …).

Learn it in depth → Bean Lifecycle in Detail

Q12. What is autowiring?

Short answer: Autowiring is Spring automatically resolving and injecting a bean's dependencies, by type first, and then by name or qualifier to resolve ambiguity. In modern code it happens implicitly through constructor injection. @Autowired is needed only on fields, setters, or when there are several constructors.

Key points to cover:

  • If no bean matches, startup fails. For optional dependencies, use Optional<T>, ObjectProvider<T> or @Autowired(required = false).
  • XML-era autowiring modes (byName, byType, constructor) still exist, but annotations replaced them.

Learn it in depth → Spring Dependency Injection

Advertisement

Follow-up questions this topic invites — and their answers

Q: How do you see which auto-configurations were applied, and why? A: Start with --debug (or debug=true) to print the conditions evaluation report, or expose the /actuator/conditions endpoint. Each entry shows whether an auto-configuration matched, and which condition decided it.

Q: How do you override an auto-configured bean? A: Define your own bean of the same type. @ConditionalOnMissingBean makes the auto-configuration back off. Or tune it with properties, for example spring.jackson.* or spring.datasource.hikari.*.

Q: What is spring-boot-maven-plugin for? A: It repackages the application into an executable "fat" JAR (with nested dependencies and a launcher), runs the app (mvn spring-boot:run), and can build OCI container images with buildpacks (mvn spring-boot:build-image).

Q: Can Spring Boot build native executables? A: Yes. With GraalVM Native Image and Boot's AOT processing (mvn -Pnative native:compile), you get fast startup and a low memory footprint. The cost is longer builds, and limits on dynamic reflection.

Advertisement

Previous

Spring Injection Types, Scopes, Profiles & WebFlux — Interview Questions

Next

Spring Boot Runners, Servers & Configuration — Interview Questions

AI Tutor

Lesson: Spring Boot Fundamentals — Interview Questions

Quick actions

AI responses can be inaccurate. Verify critical information.