LearnThatStack Ace your next interview
Backend Development
Spring Framework.
49 Qs 7 free
Change topic Change
Drill · questions

All questions

of 49
Beginner 14
01

Explain Inversion of Control (IoC) and Dependency Injection (DI).

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

What are the different types of Dependency Injection in Spring?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Spring supports three types of DI:

  1. Constructor Injection: Dependencies injected through constructor
  2. Setter Injection: Dependencies injected through setter methods
  3. 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;
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

What is the difference between @Component, @Service, @Repository, and @Controller?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

These are stereotype annotations for different layers:

  • @Component: Generic stereotype for any Spring-managed component
  • @Service: Indicates service layer components (business logic)
  • @Repository: Indicates data access layer components (DAO)
  • @Controller: Indicates presentation layer components (MVC controllers)

All are essentially @Component with semantic meaning. @Repository provides additional exception translation.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

04

What are the different ways to configure Spring applications?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Spring supports three configuration approaches:

  1. XML-based configuration: Traditional XML files
  2. Annotation-based configuration: Using annotations like @Component, @Autowired
  3. 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();
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

05

What is @Autowired and how does it work?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

@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;
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

06

What is Spring Boot and what are its advantages?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

07

What are Spring Boot Starters?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Starters are pre-configured dependency descriptors that include all necessary dependencies for specific functionality:

  • spring-boot-starter-web: Web applications (Spring MVC, Tomcat)
  • spring-boot-starter-data-jpa: JPA with Hibernate
  • spring-boot-starter-security: Spring Security
  • spring-boot-starter-test: Testing (JUnit, Mockito, TestNG)
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

08

What is @SpringBootApplication annotation?

Part of Pro
09

What are the different types of request mapping annotations?

Part of Pro
10

Explain @PathVariable, @RequestParam, and @RequestBody.

Part of Pro
11

What is the difference between @Controller and @RestController?

Part of Pro
12

What is Spring Data and what are its key features?

Part of Pro
13

What is Spring Security and what are its core features?

Part of Pro
14

Explain authentication vs authorization in Spring Security.

Part of Pro
Intermediate 23
15

What is the Spring IoC Container and what are its types?

Part of Pro
16

Explain the different bean scopes in Spring.

Part of Pro
17

Explain the Spring Bean lifecycle.

Part of Pro
18

What is the difference between @Autowired and @Resource?

Part of Pro
19

What is Spring Boot Auto-configuration and how does it work?

Part of Pro
20

Explain Spring Boot application properties and profiles.

Part of Pro
21

What is Spring MVC and explain its architecture?

Part of Pro
22

What is DispatcherServlet and what is its role?

Part of Pro
23

Explain different types of controllers in Spring MVC.

Part of Pro
24

How do you handle exceptions in Spring MVC?

Part of Pro
25

Explain JpaRepository and its hierarchy.

Part of Pro
26

How do query methods work in Spring Data JPA?

Part of Pro
27

What is @Query annotation and when would you use it?

Part of Pro
28

Explain pagination and sorting in Spring Data.

Part of Pro
29

How do you configure Spring Security?

Part of Pro
30

What are the different authentication methods in Spring Security?

Part of Pro
31

What is Aspect-Oriented Programming (AOP) in Spring?

Part of Pro
32

What are the different types of advice in Spring AOP?

Part of Pro
33

How do you test Spring applications?

Part of Pro
34

What is @SpringBootTest and its different modes?

Part of Pro
35

Explain @MockBean vs @Mock in Spring Testing.

Part of Pro
36

How do you test web controllers?

Part of Pro
37

What are Spring Profiles and how are they used?

Part of Pro
Expert 12
38

How do you create custom auto-configuration in Spring Boot?

Part of Pro
39

Explain Spring Security's filter chain.

Part of Pro
40

How do you implement JWT authentication in Spring Security?

Part of Pro
41

What is the difference between JDK dynamic proxy and CGLIB proxy?

Part of Pro
42

What is Spring WebFlux and how does it differ from Spring MVC?

Part of Pro
43

Explain Spring's transaction management.

Part of Pro
44

What is Spring Cloud and its key components?

Part of Pro
45

Explain Spring's event handling mechanism.

Part of Pro
46

What is @Conditional annotation and its use cases?

Part of Pro
47

How does Spring handle circular dependencies?

Part of Pro
48

What is Spring's ApplicationContext hierarchy?

Part of Pro
49

Explain Spring's BeanPostProcessor and BeanFactoryPostProcessor.

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

42 of 49 Spring Framework answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 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.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.