Top 120 Spring Interview Questions

This is a post on Top 120 Spring Interview Questions which discusses on top questions with proper explanation and examples. It will definitely help you to prepare the interviews.

Top 120 Spring Interview Questions

1.What is Spring framework?
2.What are the benefits of Spring framework in software development?
3.What are the modules in Core Container of Spring framework?
4.What are the modules in Data Access/Integration layer of Spring framework?
5.What are the modules in Web layer of Spring framework?
6.What is the main use of Core Container module in Spring framework?
7.What kind of testing can be done in Spring Test Module?
8.What is the use of BeanFactory in Spring framework?
9.Which is the most popular implementation of BeanFactory in Spring?
10.What is XMLBeanFactory in Spring framework?
11.What are the uses of AOP module in Spring framework?
12.What are the benefits of JDBC abstraction layer module in Spring framework?
13.How does Spring support Object Relational Mapping (ORM) integration?
14.How does Web module work in Spring framework?
15.What are the main uses of Spring MVC module?
16.What is the purpose of Spring configuration file?
17.What is the purpose of Spring IoC container?
18.What is the main benefit of Inversion of Control (IOC) principle?
19.Does IOC containers support Eager Instantiation or Lazy loading of beans?
20.What are the benefits of ApplicationContext in Spring?
21.How will you implement ApplicationContext in Spring framework?
22.Explain the difference between ApplicationContext and BeanFactory in Spring?
23.Between ApplicationContext and BeanFactory which one is preferable to use in Spring?
24.What are the main components of a typical Spring based application?
25.Explain Dependency Injection (DI) concept in Spring framework?
26.What are the different roles in Dependency Injection (DI)?
27.Spring framework provides what kinds of Dependency Injection mechanism?
28.In Spring framework, which Dependency Injection is better? Constructor-based DI or Setter-based DI?640.What are the advantages of Dependency Injection (DI)?
29.What are the disadvantages of Dependency Injection (DI)?
30.What is a Spring Bean?
31.What does the definition of a Spring Bean contain?
32.What are the different ways to provide configuration metadata to a Spring Container?
33.What are the different scopes of a Bean supported by Spring?
34.How will you define the scope of a bean in Spring?
35.Is it safe to assume that a Singleton bean is thread safe in Spring Framework?
36.What are the design-patterns used in Spring framework?
37.What is the lifecycle of a Bean in Spring framework?
38.What are the two main groups of methods in a Bean’s lifecycle?
39.Can we override main lifecycle methods of a Bean in Spring?
40.What are Inner beans in Spring?
41.How can we inject a Java Collection in Spring framework?
42.What is Bean wiring in Spring?
43.What is Autowiring in Spring?
44.What are the different modes of Autowiring supported by Spring?
45.What are the cases in which Autowiring may not work in Spring framework?
46.Is it allowed to inject null or empty String values in Spring?
47.What is a Java-based Configuration in Spring?660What is the purpose of @Configuration annotation?
48.What is the difference between Full @Configuration and ‘lite’ @Beans mode?
49.In Spring framework, what is Annotation-based container configuration?
50.How will you switch on Annotation based wiring in Spring?
51.What is @Autowired annotation?
52.What is @Required annotation?
53.What are the two ways to enable RequiredAnnotationBeanPostProcessor in Spring?
54.What is @Qualifier annotation in Spring?
55.How Spring framework makes JDBC coding easier for developers?
56.What is the purpose of JdbcTemplate?
57.What are the benefits of using Spring DAO?
58.What are the different ways to use Hibernate in Spring?
59.What types of Object Relational Mapping (ORM) are supported by Spring?
60.How will you integrate Spring and Hibernate by using HibernateDaoSupport?
61.What are the different types of the Transaction Management supported by Spring framework?
62.What are the benefits provided by Spring Framework’s Transaction Management?
63.Given a choice between declarative and programmatic Transaction Management, which method will you choose?677What is Aspect Oriented Programming (AOP)
64.What is an Aspect in Spring?
65.In Spring AOP, what is the main difference between a Concern and a Cross cutting concern?
66.What is a Joinpoint in Spring AOP?
67.What is an Advice in Spring AOP?
68.What are the different types of Advice in Spring AOP?
69.What is a Pointcut in Spring AOP?
70.What is an Introduction in Spring AOP?
71.What is a Target object in Spring AOP?
72.What is a Proxy in Spring AOP?
73.What are the different types of AutoProxy creators in Spring?
74.What is Weaving in Spring AOP?
75.In Spring AOP, Weaving is done at compile time or run time?
76.What is XML Schema-based Aspect implementation?
77.What is Annotation-based aspect implementation in Spring AOP?
78.How does Spring MVC framework work?
79.What is DispatcherServlet?
80.Can we have more than one DispatcherServlet in Spring MVC?
81.What is WebApplicationContext in Spring MVC?
82.What is Controller in Spring MVC framework?
83.What is @RequestMapping annotation in Spring?698What are the main features of Spring MVC?
84.What is the difference between a Singleton and Prototype bean in Spring?
85.How will you decide which scope- Prototype or Singleton to use for a bean in Spring?
86.What is the difference between Setter and Constructor based Dependency Injection (DI) in Spring framework?
87.What are the drawbacks of Setter based Dependency Injection (DI) in Spring?
88.What are the differences between Dependency Injection (DI) and Factory Pattern?
89.In Spring framework, what is the difference between FileSystemResource and ClassPathResource?
90.Name some popular Spring framework annotations that you use in your project?
91.How can you upload a file in Spring MVC Application?
92.What are the different types of events provided by Spring framework?
93.What is the difference between DispatcherServlet and ContextLoaderListener in Spring?
94.How will you handle exceptions in Spring MVC Framework?
95.What are the best practices of Spring Framework?
96.What is Spring Boot? What are the advantages of Spring Boot?
97.What are the different Spring Boot Components?
98.What is Spring Boot Starters?
99.Name some of the starter provided by Spring Boot?
100.What is Auto-Configuration in Spring Boot?
101.Can we use Spring Boot for non-Spring application?
102.What are the different options for creating the Spring Boot application
103.What is the Spring Boot Initilizr? What are the advantages of Spring Boot Initializr?
104.How can I reload my Spring Boot changes without restarting the server?
105.How can we override default properties in Spring Boot?
106.What are the embedded containers supported by Spring Boot?
107.What is the Spring Boot Actuator?
108.How can we create a custom endpoint in Spring Boot Actuator?
109.How to run Spring Boot application to custom port?
110.What logging support provided by Spring Boot? How can we control logging level in Spring Boot?
111.How to implement security for Spring boot application?
112.How to configure database using Spring Boot?
113.Why do we need spring-boot-maven-plugin?
114.How to disable specific auto-configuration in spring boot?
115.What is the use of YAML in Spring Boot?
116.What is new in Spring Boot 2.0?
117.What is @SpringBootApplication annotation?
118.How to include custom static content in Spring Boot application (e.g custom JS code)?
119.How to use a profile with Spring Boot?
120.How to generate a WAR file with Spring Boot?

That’s all about Top 120 Spring Interview Questions.

Leave a Comment


Please share it if you found this useful
Hide Buttons