• Stars
    star
    642
  • Rank 70,103 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

200+ Questions and Answers on Spring, Spring Boot and Spring MVC

Spring Interview Guide - 200+ Questions and Answers

Image

Spring Framework is the most popular Java Framework ever. It continues to evolve with changing architectures. Spring Boot is one of the most popular Spring projects. Spring Boot is the most used Java framework to develop RESTful Services and Microservices.

Preparing for Spring Interview is tricky. There are wide variety of Spring Modules and Spring Projects you would need to recollect and be prepared to answer questions on.You would need to get a good understanding of the new features of Spring and have firm grasp of the concepts you implemented in your projects.

This course helps you prepare for Spring Interview with code examples covering 200+ Spring Interview Questions and Answers on Spring, Spring Boot, Spring MVC, Spring JDBC, JPA, AOP, RESTful Services and SOAP Web Services.

List of questions discussed about each topic is listed below.

Spring

  • What is Loose Coupling?
  • What is a Dependency?
  • What is IOC (Inversion of Control)?
  • What is Dependency Injection?
  • Can you give few examples of Dependency Injection?
  • What is Auto Wiring?
  • What are the important roles of an IOC Container?
  • What are Bean Factory and Application Context?
  • Can you compare Bean Factory with Application Context?
  • How do you create an application context with Spring?
  • How does Spring know where to search for Components or Beans?
  • What is a Component Scan?
  • How do you define a component scan in XML and Java Configurations?
  • How is it done with Spring Boot?
  • What does @Component signify?
  • What does @Autowired signify?
  • What’s the difference Between @Controller, @Component, @Repository, and @Service Annotations in Spring?
  • What is the default scope of a bean?
  • Are Spring beans thread safe?
  • What are the other scopes available?
  • How is Spring’s singleton bean different from Gang of Four Singleton Pattern?
  • What are the different types of dependency injections?
  • What is setter injection?
  • What is constructor injection?
  • How do you choose between setter and constructor injections?
  • What are the different options available to create Application Contexts for Spring?
  • What is the difference between XML and Java Configurations for Spring?
  • How do you choose between XML and Java Configurations for Spring?
  • How does Spring do Autowiring?
  • What are the different kinds of matching used by Spring for Autowiring?
  • How do you debug problems with Spring Framework?
  • How do you solve NoUniqueBeanDefinitionException?
  • How do you solve NoSuchBeanDefinitionException?
  • What is @Primary?
  • What is @Qualifier?
  • What is CDI (Contexts and Dependency Injection)?
  • Does Spring Support CDI?
  • Would you recommed to use CDI or Spring Annotations?
  • What are the major features in different versions of Spring?
  • What are new features in Spring Framework 4.0?
  • What are new features in Spring Framework 5.0?
  • What are important Spring Modules?
  • What are important Spring Projects?
  • What is the simplest way of ensuring that we are using single version of all Spring related dependencies?
  • Name some of the design patterns used in Spring Framework?
  • What do you think about Spring Framework?
  • Why is Spring Popular?
  • Can you give a big picture of the Spring Framework?

Spring MVC

  • What is Model 1 architecture?
  • What is Model 2 architecture?
  • What is Model 2 Front Controller architecture?
  • Can you show an example controller method in Spring MVC?
  • Can you explain a simple flow in Spring MVC?
  • What is a ViewResolver?
  • What is Model?
  • What is ModelAndView?
  • What is a RequestMapping?
  • What is Dispatcher Servlet?
  • How do you set up Dispatcher Servlet?
  • What is a form backing object?
  • How is validation done using Spring MVC?
  • What is BindingResult?
  • How do you map validation results to your view?
  • What are Spring Form Tags?
  • What is a Path Variable?
  • What is a Model Attribute?
  • What is a Session Attribute?
  • What is a init binder?
  • How do you set default date format with Spring?
  • Why is Spring MVC so popular?

Spring Boot

  • What is Spring Boot?
  • What are the important Goals of Spring Boot?
  • What are the important Features of Spring Boot?
  • Compare Spring Boot vs Spring?
  • Compare Spring Boot vs Spring MVC?
  • What is the importance of @SpringBootApplication?
  • What is Auto Configuration?
  • How can we find more information about Auto Configuration?
  • What is an embedded server? Why is it important?
  • What is the default embedded server with Spring Boot?
  • What are the other embedded servers supported by Spring Boot?
  • What are Starter Projects?
  • Can you give examples of important starter projects?
  • What is Starter Parent?
  • What are the different things that are defined in Starter Parent?
  • How does Spring Boot enforce common dependency management for all its Starter projects?
  • What is Spring Initializr?
  • What is application.properties?
  • What are some of the important things that can customized in application.properties?
  • How do you externalize configuration using Spring Boot?
  • How can you add custom application properties using Spring Boot?
  • What is @ConfigurationProperties?
  • What is a profile?
  • How do you define beans for a specific profile?
  • How do you create application configuration for a specific profile?
  • How do you have different configuration for different environments?
  • What is Spring Boot Actuator?
  • How do you monitor web services using Spring Boot Actuator?
  • How do you find more information about your application envrionment using Spring Boot?
  • What is a CommandLineRunner?

Database Connectivity - JDBC, Spring JDBC & JPA

  • What is Spring JDBC? How is different from JDBC?
  • What is a JdbcTemplate?
  • What is a RowMapper?
  • What is JPA?
  • What is Hibernate?
  • How do you define an entity in JPA?
  • What is an Entity Manager?
  • What is a Persistence Context?
  • How do you map relationships in JPA?
  • What are the different types of relationships in JPA?
  • How do you define One to One Mapping in JPA?
  • How do you define One to Many Mapping in JPA?
  • How do you define Many to Many Mapping in JPA?
  • How do you define a datasource in a Spring Context?
  • What is the use of persistence.xml
  • How do you configure Entity Manager Factory and Transaction Manager?
  • How do you define transaction management for Spring – Hibernate integration?

Spring Data

  • What is Spring Data?
  • What is the need for Spring Data?
  • What is Spring Data JPA?
  • What is a CrudRepository?
  • What is a PagingAndSortingRepository?

Unit Testing

  • How does Spring Framework Make Unit Testing Easy?
  • What is Mockito?
  • What is your favorite mocking framework?
  • How do you do mock data with Mockito?
  • What are the different mocking annotations that you worked with?
  • What is MockMvc?
  • What is @WebMvcTest?
  • What is @MockBean?
  • How do you write a unit test with MockMVC?
  • What is JSONAssert?
  • How do you write an integration test with Spring Boot?
  • What is @SpringBootTest?
  • What is @LocalServerPort?
  • What is TestRestTemplate?

AOP

  • What are cross cutting concerns?
  • How do you implement cross cutting concerns in a web application?
  • If you would want to log every request to a web application, what are the options you can think of?
  • If you would want to track performance of every request, what options can you think of?
  • What is an Aspect and Pointcut in AOP?
  • What are the different types of AOP advices?
  • What is weaving?
  • Compare Spring AOP vs AspectJ?

SOAP Web Services

  • What is a Web Service?
  • What is SOAP Web Service?
  • What is SOAP?
  • Waht is a SOAP Envelope?
  • What is SOAP Header and SOAP Body?
  • Can you give an example of SOAP Request and SOAP Response?
  • What is a SOAP Header? What kind of information is sent in a SOAP Header?
  • Can you give an example of a SOAP Header with Authentication information?
  • What is WSDL (Web Service Definition Language)?
  • What are the different parts of a WSDL?
  • What is Contract First Approach?
  • What is an XSD?
  • Can you give an example of an XSD?
  • What is JAXB?
  • How do you configure a JAXB Plugin?
  • What is an Endpoint?
  • Can you show an example endpoint written with Spring Web Services?
  • What is a MessageDispatcherServlet?
  • How do you configure a MessageDispatcherServlet?
  • How do you generate a WSDL using Spring Web Services?
  • How do you implement error handling for SOAP Web Services?
  • What is a SOAP Fault?

RESTful Web Services

  • What is REST?
  • What are the key concepts in designing RESTful API?
  • What are the Best Practices of RESTful Services?
  • Can you show the code for an example Get Resource method with Spring REST?
  • What happens when we return a bean from a Request Mapping Method?
  • What is GetMapping and what are the related methods available in Spring MVC?
  • Can you show the code for an example Post Resource method with Spring REST?
  • What is the appropriate HTTP Response Status for successful execution of a Resource Creation?
  • Why do we use ResponseEntity in a RESTful Service?
  • What is HATEOAS?
  • Can you give an Example Response for HATEOAS?
  • How do we implement it using Spring?
  • How do you document RESTful web services?
  • Can you give a brief idea about Swagger Documentation?
  • How do you automate generation of Swagger Documentation from RESTful Web Services?
  • How do you add custom information to Swagger Documentation generated from RESTful Web Services?
  • What is Swagger-UI?
  • What is "Representation" of a Resource?
  • What is Content Negotiation?
  • Which HTTP Header is used for Content Negotiation?
  • How do we implement it using Spring Boot?
  • How do you add XML support to your RESTful Services built with Spring Boot?
  • How do you implement Exception Handling for RESTFul Web Services?
  • What are the best practices related to Exception Handling with respect to RESTful Web Services?
  • What are the different error status that you would return in RESTful Web Services?
  • How would you implement them using Spring Boot?
  • What HTTP Response Status do you return for validation errors?
  • How do you handle Validation Errors with RESTful Web Services?
  • Why do we need Versioning for RESTful Web Services?
  • What are the versioning options that are available?
  • How do you implement Versioning for RESTful Web Services?

Getting Started

Installing Tools

Git Repository

Presentation

  • Downlad the zip or clone the git
  • Unzip the zip file
  • Go to folder 1.presentation
  • Launch spring-interview-questions.html in your favorite browser

Running Examples

  • Download the zip or clone the Git repository.
  • Unzip the zip file (if you downloaded one)
  • Open Command Prompt and Change directory (cd) to folder containing pom.xml
  • Open Eclipse
    • File -> Import -> Existing Maven Project -> Navigate to the folder where you unzipped the zip
    • Select the right project
  • Choose the Spring Boot Application file (search for file with @SpringBootApplication)
  • Right Click on the file and Run as Java Application
  • You are all Set
  • For help : use our installation guide - https://www.youtube.com/playlist?list=PLBBog2r6uMCSmMVTW_QmDLyASBvovyAO3

What Will I Learn?

  • You will learn to answer 200 interview questions on Spring, Spring Boot and Spring MVC
  • You will learn to answer questions on basics of JPA, Spring Data, Spring Data JPA, Spring AOP
  • You will learn to answer questions on RESTful Web Services and SOAP Web Services with Spring & Spring Boot
  • You will learn to answer questions on basics of Spring Framework - IOC, Application Context, Dependency Injection, Scope and Component Scan
  • You will learn about Spring Annotations - @Component, @Service, @Repository, @Controller, @Autowired, @Primary, @Qualifier, @Configuration
  • You will understand basic features of Spring Boot - Starters, Auto Configuration, Actuator and Externalized Configuration
  • You will be introduced to the Best Practices in using Spring and Spring Boot
  • You will be introduced to the approaches to handle validation errors with Spring MVC and Spring REST
  • You will be introduced to the approaches for Versioning, Content Negotiation with RESTful Services
  • You will understand the best practices in documenting your RESTful Services with Swagger

Requirements

  • We use Eclipse as the IDE to demonstrate 100 code examples
  • You should have some programming experience with Java and Spring

Who is the target audience?

  • You are learning Java
  • You are learning Spring
  • You want to attend Java & Spring Interviews
  • You want to add more depth to your Spring Knowledge

Troubleshooting

Youtube Playlists - 500+ Videos

Click here - 30+ Playlists with 500+ Videos on Spring, Spring Boot, REST, Microservices and the Cloud

Keep Learning in28Minutes

in28Minutes is creating amazing solutions for you to learn Spring Boot, Full Stack and the Cloud - Docker, Kubernetes, AWS, React, Angular etc. - Check out all our courses here

in28MinutesLearningRoadmap-July2019.png

More Repositories

1

devops-master-class

Devops Tutorial for Beginners - Learn Docker, Kubernetes, Terraform, Ansible, Jenkins and Azure Devops
Java
2,203
star
2

spring-microservices

Microservices using Spring Boot, Spring Cloud, Docker and Kubernetes
Java
1,770
star
3

java-tutorial-for-beginners

Java Tutorial For Beginners with 500 Code Examples
1,312
star
4

java-best-practices

Best practices in Coding, Designing and Architecting Java Applications
1,254
star
5

master-spring-and-spring-boot

Spring and Spring Boot Tutorial For Absolute Beginners - 10-in-1 - Spring to Spring Boot to REST API to Full Stack to Containers to Cloud
Java
1,226
star
6

spring-boot-examples

Code Examples for everything thats written on www.springboottutorial.com
Java
1,207
star
7

spring-master-class

An updated introduction to the Spring Framework 5. Become an Expert understanding the core features of Spring In Depth. You would write Unit Tests, AOP, JDBC and JPA code during the course. Includes introductions to Spring Boot, JPA, Eclipse, Maven, JUnit and Mockito.
Java
1,142
star
8

java-a-course-for-beginners

Java Programming Tutorial for Beginners
JavaScript
1,044
star
9

JavaInterviewQuestionsAndAnswers

Java Interview Questions and Answers
Java
973
star
10

spring-boot-master-class

Understand and love the power of Spring Boot - All its features are illustrated developing a web application managing todos and a basic API for survey questionnaire. Also covers unit testing, mocking and integration testing.
Java
965
star
11

course-material

Course Material for in28minutes courses on Java, Spring Boot, DevOps, AWS, Google Cloud, and Azure.
947
star
12

SpringMvcStepByStep

Spring MVC Tutorial for beginners - In 25 Small Steps
Java
828
star
13

spring-microservices-v2

Microservices + Spring Boot 2 + Spring Cloud + Docker + Kubernetes - https://www.udemy.com/course/microservices-with-spring-boot-and-spring-cloud/. Latest Repo - http://github.com/in28minutes/spring-microservices-v3
JavaScript
714
star
14

learn

How do you achieve your career objectives? Complete career paths with amazing Cloud, Full Stack and Microservice Courses and Videos from in28Minutes
685
star
15

SpringIn28Minutes

Spring Tutorial For Beginners
Java
657
star
16

MockitoTutorialForBeginners

Mockito Tutorial for Beginners
Java
632
star
17

jpa-with-hibernate

Master JPA using Hibernate as the implementation. Learn the basics of JPA - entities, relationships, entity manager, annotations, JPQL and Criteria API. Take a step into the advanced world of JPA - caching, performance tuning(n + 1 queries), mapping inheritance hierarchies. Get a peek into the magic of Spring Data JPA & Spring Data Rest.
Java
630
star
18

SpringBootForBeginners

Spring Boot Tutorial For Beginners
Java
609
star
19

full-stack-with-react-and-spring-boot

Your First Full Stack Application with React and Spring Boot
Java
606
star
20

full-stack-with-angular-and-spring-boot

Your First Full Stack Application with Angular and Spring Boot
Java
605
star
21

in28minutes-initiatives

All initiatives to build a connect between industry, instructors and learners
596
star
22

java-cheat-sheet

Java Tutorial For Beginners - Companion Reference
588
star
23

JavaWebApplicationStepByStep

JSP Servlets Tutorial For Beginners - in 25 Steps
Java
534
star
24

spring-web-services

Spring Web Services - SOAP and RESTful
Java
532
star
25

spring-unit-testing-with-junit-and-mockito

Spring Unit Testing with JUnit and Mockito
Java
359
star
26

docker-crash-course

Docker for beginners - with Java and Spring Boot Applications and Microservices
Java
350
star
27

functional-programming-with-java

Learn Functional Programming with Java using a Hands-on Step by Step Approach
Java
340
star
28

kubernetes-crash-course

Learn Kubernetes and Docker with Google Kubernetes Engine deploying Spring Boot Microservices
Java
327
star
29

interview-guide

Java interview guide - 200+ Question and Answers
297
star
30

deploy-spring-microservices-to-aws-ecs-fargate

Take your first steps towards cloud with AWS ECS Fargate. Deploy REST APIs and Microservices with Spring Boot and Docker Containers to the cloud.
Java
265
star
31

SpringBootWebApplicationStepByStep

Develop your first web application with Spring Boot Magic
Java
256
star
32

spring-boot-react-fullstack-examples

All full stack examples with Spring Boot and React for articles on our website http://www.springboottutorial.com
JavaScript
255
star
33

roadmaps

Roadmaps of in28minutes courses!
245
star
34

spring-microservices-v3

JavaScript
228
star
35

JUnitIn28Minutes

JUNIT Tutorial For Beginners
Java
216
star
36

automation-testing-with-java-and-selenium

Learn Automation Testing with Java and Selenium
HTML
193
star
37

MavenIn28Minutes

Maven Tutorial for Beginners with Examples
Java
193
star
38

python-tutorial-for-beginners

Python Tutorial for Beginners with 500 Code Examples
182
star
39

in28minutes.github.io

Spring Boot Tutorials
HTML
171
star
40

deploy-spring-boot-aws-eb

Deploying Spring Boot Apps to AWS using Elastic Beanstalk
Java
160
star
41

getting-started-in-5-steps

How to install and get started with Java, Eclipse, Maven, JUnit, Mockito & Spring in 5 easy steps
JavaScript
154
star
42

clean-code

Learn to Write Clean Code with Java. Get Hands-on with 20+ Code Examples involving 4 principles of Simple Design, Refactoring and TDD.
JavaScript
153
star
43

first-steps-to-software-architect

How to start your journey towards software architecture?
136
star
44

MockitoIn28Minutes

Learn Mockito from In28Minutes
Java
121
star
45

learning-paths-cloud-and-devops

How to learn Cloud and DevOps
119
star
46

spring-boot-angular-fullstack-examples

All full stack examples with Spring Boot and Angular for articles on our website http://www.springboottutorial.com
TypeScript
109
star
47

in28Minutes-Course-Roadmap

A Roadmap for our Courses. Remember we focus on Java, Microservices, Web Applications and are big Spring Shop - Spring, Spring MVC, Spring Boot, Spring Cloud...
104
star
48

docker

Docker for Beginners - Learn Docker in 5 Steps
Java
101
star
49

pcf-crash-course-with-spring-boot

PCF Crash Course for Java, Spring and Spring Boot Developers - Deploy Spring Boot REST API, Full Stack Applications and Microservices to Pivotal Cloud Foundry (PCF)
Java
98
star
50

azure-devops-kubernetes-terraform-pipeline

https://github.com/in28minutes/devops-master-class
Java
87
star
51

deploy-spring-boot-to-azure

Deploy Spring Boot Applications to Azure Web Apps
Java
82
star
52

camel

Learn Enterprise Integration Patterns with Apache Camel
JavaScript
80
star
53

Design-Patterns-For-Beginners

Design Patterns for Beginners
80
star
54

JavaObjectOrientedProgramming

Learn basics of object oriented programming with Java
Java
69
star
55

learn-programming-with-python-

learn-programming-with-python​
Python
67
star
56

10-Steps-to-High-Quality-Java-Developer

You Key to Becoming a High Quality Java Developer
61
star
57

java-to-python-in-100-steps

Learn Python using your Java Knowledge
Python
58
star
58

java-technology-for-beginners

In my 15 years of designing and developing more than 100 java web applications, there are a number of terminologies, standards, frameworks, tools that I have used. I know how difficult it is for a beginner to understand them. And imagine the trouble non techies face - the business, testing teams and others. So, this guide is to demystify these terms! Enough talk. Let's Rock and Roll......
58
star
59

spring-boot-vuejs-fullstack-examples

All full stack examples with Spring Boot and Vue JS for articles on our website http://www.springboottutorial.com
Java
57
star
60

EclipseIn28Minutes

Eclipse Tutorial for Beginners - From in28Minutes
53
star
61

jenkin-devops-microservice

https://github.com/in28minutes/devops-master-class
Java
49
star
62

spring-complete-career-path

Level 1 covers Basics of Spring Developing a web application with Spring MVC Basics of Spring Boot - Autoconfiguration, Starter Projects Basic Todo Management Application with Login/Logout Model, Controllers, ViewResolver and Filters Forms - DataBinding, Validation Bootstrap to style the page Spring Security Exception Handling Level 2 (coming soon) will cover Rest APIs with Spring Boot SOAP Web Services with Spring Boot. Level 3 (coming soon) will cover Spring Cloud Microservices
Java
44
star
63

go-serverless

Go Serverless with AWS Lambda and Azure Functions - Udemy Course https://www.udemy.com/course/serverless-tutorial-aws-lambda-and-azure-functions
JavaScript
41
star
64

Tips-Database

Tips about Web Services, APIs, Microservices, Spring, Spring Boot, Maven, Eclipse etc
37
star
65

TDDin28Minutes

TDD Tutorial For Beginners - from in28Minutes
Java
31
star
66

spring-boot-to-cloud

Spring Boot to Cloud (AWS, Azure, GCP and PCF) with Docker and Kubernetes
Java
30
star
67

JavaTutorialForBeginners

Java Tutorial for Beginners with examples
Java
29
star
68

BasicWebServletsIn28Minutes

Java
28
star
69

campus-interview-guide

60 Day Learning Challenges for Campus Interviews
28
star
70

CTutorialForBeginners

C Tutorial for Beginners
27
star
71

Java-EE-Design-Patterns

26
star
72

HibernateJPAStepByStep

Hibernate Tutorial For Beginners - Step by Step with Examples
22
star
73

in28minutes.com

Awesome Courses from the Best Selling Instructor
HTML
22
star
74

RealWorldWebApplicationWithServletsAndJspIn28Minutes

Learn to Develop your first web application with Servlets and JSP
Java
20
star
75

cloud.in28minutes.com

cloud.in28minutes.com
HTML
20
star
76

jenkins-pipeline

Java
18
star
77

spring-boot-rest-api-playground

Java
18
star
78

spring-microservices-v3-old

JavaScript
16
star
79

microservice-reference-archetype

Java
14
star
80

hello-world-rest-api-aws-ecs-codepipeline

Java
14
star
81

Struts2StepByStep

Learn Struts 2 Step By Step
Java
11
star
82

jshell-for-java-programmers

An introduction to JShell for Java Programmers
11
star
83

hello-world-rest-api-azure-pipelines

Java
10
star
84

in28minutes

9
star
85

getting-started-for-beginners-v2

Updated Getting Started Guides for Beginners Recorded with Spring Boot 3 - Spring, Spring Boot, JUnit, Mockito, JPA, Hibernate ....
Java
9
star
86

spring-boot-todo-rest-api-h2-aws-codepipeline

Java
8
star
87

In28MinutesTemplate

Serves as template for my new courses
8
star
88

todo-app

Java
6
star
89

automatewithselenium.com

Learn how to automate your tests with Selenium - Java, Python, C# and JavaScript - automatewithselenium.com
CSS
6
star
90

dev-config-server-test

4
star
91

config-server

2
star
92

programmingabc.com

Master Content for our Programming Website - programmingabc.com
CSS
2
star
93

Future-Course-Preparation

1
star
94

hello-world-playground

Java
1
star