Sample Grokking the Spring Boot Interview
Sample Grokking the Spring Boot Interview
to
Table Of Contents
Overview 2
Why Prepare For The Spring Boot Interview? 5
How to Prepare for Spring Boot Interviews? 8
Topics 11
Spring Core Framework 13
1. W
hat is the Spring framework? Why should Java
programmers use the Spring framework? 15
2. What is the Dependency Injection design pattern? 16
3. What is the Inversion of Control concept, how does
Spring support IOC? 16
4. How do you configure Spring Framework? 18
5. Can we use more than one configuration file for our
Spring project?
18
6. What types of dependency injection are supported
by Spring Framework? When do you use Setter and
Constructor Injection, the pros and cons?
18
7.Difference between the setter and constructor injection
in Spring?
19
8. Difference between Factory Pattern and Dependency
Injection in Java? 21
9. What are the different modules in spring? 21
10. What is the difference between Spring MVC and Spring
core? 21
11. What is
AOP? How is it implemented in Spring? 22
12. What is
Advice in AOP? 23
13. What are
the joint Point and point cut? 23
14. What is
component scanning in Spring Framework? 23
Container, Dependency, and IOC 25
1. W
hat is dependency injection and what are the
advantages of using it? 26
2. What is an interface and what are the advantages of
making use of them in Java?
27
3. What is an ApplicationContext in Spring? 28
4. How are you going to create a new instance of an
ApplicationContext? 29
5. Can you describe the lifecycle of a Spring Bean in an
ApplicationContext? 31
6. How are you going to create an ApplicationContext in an
integration test?
33
7.What is the preferred way to close an application
context? Does Spring Boot do this for you? 34
8. What is Dependency injection using Java configuration?
35
9. What is Dependency injection using annotations (@
Autowired)?–Component scanning, Stereotypes?–Scopes
for Spring beans? 35
10. What is
the default scope? 35
11. Ar
e beans lazily or eagerly instantiated by default? How
do you alter this behavior? 35
12. What is a property source? How would you use @
PropertySource? 36
13. What is a BeanFactoryPostProcessor and what is it used
for? When is it invoked? 36
14. W
hy would you define a static @Bean method when
creating your own BeanFactoryPostProcessor?
37
15. What is a PropertySourcesPlaceholderConfigurer used
for? 37
1. Core spring
2. Container, Dependency Injections and IoC
3. Spring Aspect-Oriented Programming
4. Bean Life Cycle
5. Spring MVC
6. REST
7. Spring Cloud
8. Microservices
9. Spring Data JPA
10. Spring Boot Testing
11. Spring Security
12. Spring Boot Core Concepts
13. Spring Boot Actuator
The
org.springframework.beans.factory.xml.
XmlBeanFactory is used to create bean
instances defined in our XML file.
Or
1. @SpringBootApplication
You can run them just like you can run the
main class in Java, this annotation is used to
annotate the main class of your Spring Boot
application. It
package boot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.
SpringBootApplication;
import org.springframework.web.bind.annotation.
RequestMapping;
import org.springframework.web.bind.annotation.
RestController;
@SpringBootApplication
public class SpringBootDemo {
@RestController
class HelloController{
@RequestMapping(“/”)
public String hello(){
return “Hello Spring Boot”;
}
@RunWith(SpringRunner.class) @ContextConfiguration(classes =
public class BookBorrowServiceJUnit4ContextTests implements A
//some code to test
}
https://gum.co/hrUXKY