All questions
Showing of 74Explain the difference between Spring and Spring Boot.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
| Aspect | Spring | Spring Boot |
|---|---|---|
| Configuration | Manual XML/Java configuration | Auto-configuration |
| Server Setup | External server required | Embedded server included |
| Dependencies | Manual dependency management | Starter dependencies |
| Deployment | WAR files to external servers | Executable JAR files |
| Development Time | More setup and configuration | Faster development |
Spring Boot is built on top of Spring framework and provides opinionated defaults to get started quickly.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are Spring Boot Starters? Name some commonly used starters.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Spring Boot Starters are dependency descriptors that include a set of convenient dependency management for specific functionality.
Common starters:
spring-boot-starter-web: Web applications with REST APIsspring-boot-starter-data-jpa: JPA with Hibernatespring-boot-starter-security: Spring Securityspring-boot-starter-test: Testing framework with JUnit, Mockitospring-boot-starter-actuator: Monitoring and managementspring-boot-starter-data-redis: Redis data accessspring-boot-starter-mail: Email support
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain the @SpringBootApplication annotation.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
@SpringBootApplication is a convenience annotation that combines three annotations:
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Equivalent to:
@Configuration: Indicates configuration class@EnableAutoConfiguration: Enables auto-configuration@ComponentScan: Enables component scanning in current package and sub-packages
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between @Component, @Service, @Repository, and @Controller?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
All are specializations of @Component for specific layers:
- @Component: Generic stereotype for any Spring-managed component
- @Service: Business logic layer components
- @Repository: Data access layer components (adds exception translation)
- @Controller: Presentation layer components for handling HTTP requests
@Service
public class UserService { }
@Repository
public class UserRepository { }
@Controller
public class UserController { }
Functionally similar, but provide better semantic meaning and potential for additional features.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
How do you create a RESTful web service in Spring Boot?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
@RestController
@RequestMapping("/api/users")
public class UserController {
@Autowired
private UserService userService;
@GetMapping
public List<User> getAllUsers() {
return userService.findAll();
}
@GetMapping("/{id}")
public User getUser(@PathVariable Long id) {
return userService.findById(id);
}
@PostMapping
public User createUser(@RequestBody User user) {
return userService.save(user);
}
@PutMapping("/{id}")
public User updateUser(@PathVariable Long id, @RequestBody User user) {
return userService.update(id, user);
}
@DeleteMapping("/{id}")
public void deleteUser(@PathVariable Long id) {
userService.delete(id);
}
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between @RequestMapping and @GetMapping?
Explain Spring Boot's embedded server concept.
What are the different ways to run Spring Boot applications?
What is the difference between @RestController and @Controller?
What are Spring Boot DevTools and how do they improve development?
Explain Inversion of Control (IoC) and Dependency Injection (DI).
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
IoC is a design principle where the control of object creation and management is transferred from the application code to an external container (Spring Container).
DI is the implementation of IoC where dependencies are injected into objects rather than objects creating their dependencies.
// Without DI - tight coupling
public class UserService {
private UserRepository userRepository = new UserRepository(); // Tight coupling
}
// With DI - loose coupling
public class UserService {
private UserRepository userRepository;
public UserService(UserRepository userRepository) {
this.userRepository = userRepository; // Dependency injected
}
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are the different types of Dependency Injection in Spring?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Spring supports three types of DI:
- Constructor Injection: Dependencies injected through constructor
- Setter Injection: Dependencies injected through setter methods
- Field Injection: Dependencies injected directly into fields using @Autowired
// Constructor Injection (Recommended)
@Service
public class UserService {
private final UserRepository userRepository;
public UserService(UserRepository userRepository) {
this.userRepository = userRepository;
}
}
// Setter Injection
@Service
public class UserService {
private UserRepository userRepository;
@Autowired
public void setUserRepository(UserRepository userRepository) {
this.userRepository = userRepository;
}
}
// Field Injection
@Service
public class UserService {
@Autowired
private UserRepository userRepository;
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are the different ways to configure Spring applications?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Spring supports three configuration approaches:
- XML-based configuration: Traditional XML files
- Annotation-based configuration: Using annotations like @Component, @Autowired
- Java-based configuration: Using @Configuration classes
// Java-based configuration
@Configuration
public class AppConfig {
@Bean
public UserService userService() {
return new UserService(userRepository());
}
@Bean
public UserRepository userRepository() {
return new UserRepository();
}
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is @Autowired and how does it work?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
@Autowired enables automatic dependency injection. Spring automatically injects matching beans by type. It can be used on:
- Constructors
- Setter methods
- Fields
- Method parameters
@Service
public class UserService {
@Autowired
private UserRepository userRepository; // Field injection
@Autowired
public UserService(UserRepository userRepository) { // Constructor injection
this.userRepository = userRepository;
}
}
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is Spring Boot and what are its advantages?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Spring Boot is an opinionated framework that simplifies Spring application development by providing:
- Auto-configuration: Automatically configures Spring applications
- Starter dependencies: Pre-configured dependency sets
- Embedded servers: Tomcat, Jetty, Undertow embedded
- Production-ready features: Metrics, health checks, externalized configuration
- No XML configuration: Convention over configuration
- Standalone applications: JAR files with embedded servers
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is @SpringBootApplication annotation?
What are the different types of request mapping annotations?
Explain @PathVariable, @RequestParam, and @RequestBody.
What is Spring Data and what are its key features?
What is Spring Security and what are its core features?
Explain authentication vs authorization in Spring Security.
What is auto-configuration in Spring Boot? How does it work?
How do you configure different environments in Spring Boot?
Explain dependency injection in Spring Boot with examples.
What is Spring Boot Actuator and what are its key features?
How do you handle exceptions globally in Spring Boot?
What is Spring Data JPA and how do you use it in Spring Boot?
Explain the difference between @Autowired, @Inject, and @Resource.
How do you implement validation in Spring Boot?
What are Spring Boot profiles and how do you use them?
How do you configure and use caching in Spring Boot?
What is the difference between @Component and @Bean?
How do you implement security in Spring Boot?
How do you test Spring Boot applications?
What is the difference between @MockBean and @Mock?
How do you implement asynchronous processing in Spring Boot?
How do you implement custom health checks in Spring Boot Actuator?
How do you implement pagination and sorting in Spring Boot?
Explain Spring Boot's logging configuration.
How do you implement database migration in Spring Boot?
Explain Spring Boot's transaction management.
How do you implement file upload and download in Spring Boot?
What is the Spring IoC Container and what are its types?
Explain the different bean scopes in Spring.
Explain the Spring Bean lifecycle.
What is the difference between @Autowired and @Resource?
Explain Spring Boot application properties and profiles.
What is Spring MVC and explain its architecture?
What is DispatcherServlet and what is its role?
Explain different types of controllers in Spring MVC.
Explain JpaRepository and its hierarchy.
How do query methods work in Spring Data JPA?
What is @Query annotation and when would you use it?
How do you configure Spring Security?
What are the different authentication methods in Spring Security?
What is Aspect-Oriented Programming (AOP) in Spring?
What are the different types of advice in Spring AOP?
What is @SpringBootTest and its different modes?
How do you test web controllers?
Explain Spring Boot's auto-configuration process with @ConditionalOn annotations.
Explain Spring Boot's configuration precedence.
How do you implement custom auto-configuration in Spring Boot?
What is Spring Boot's approach to microservices?
How do you secure REST APIs in Spring Boot using JWT?
Explain Spring Security's filter chain.
How do you implement JWT authentication in Spring Security?
What is the difference between JDK dynamic proxy and CGLIB proxy?
What is Spring WebFlux and how does it differ from Spring MVC?
What is Spring Cloud and its key components?
Explain Spring's event handling mechanism.
What is @Conditional annotation and its use cases?
How does Spring handle circular dependencies?
What is Spring's ApplicationContext hierarchy?
Explain Spring's BeanPostProcessor and BeanFactoryPostProcessor.
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Spring Boot cheatsheet
- Spring Boot Basics01
- Core Annotations02
- Dependency Injection & IoC03
- Configuration04
- REST APIs05
- Data Access (JPA)06
- Exception Handling07
- Security08
- Testing09
- Actuator & Monitoring10
- Best Practices11
- Key Concepts & Comparisons12
- + 2 more inside
- + 8 more inside
64 of 74 Spring Boot answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.