Interview questions

Spring Framework Interview Questions & Answers – Set 1

This is a practice test / interview questions and answers for Java Developers working on Spring Framework. These questions can be used to check your knowledge on Spring framework fundamentals. They could be useful and helpful in preparing you for upcoming interview in relation with Spring framework.

The following are some of the topics in relation with Spring Framework Fundamentals which are covered in this practice test:

  • Spring IOC concepts
    • Configuration metadata
    • Beans packages for IOC container
  • Beans instantiation
  • Different types of DI techniques (Constructor-based, Setter-based DI)
  • Beans initialization (Eager / lazy initialization)
  • Method injection techniques (lookup method, arbitrary method injection)
  • Bean Scopes (Singleton, Prototype, Request, Session, Application, WebSocket)



Practice Test on Spring Framework Fundamentals

Which of the following packages forms the basis of Spring framework IOC container?

Correct! Wrong!

____________ is a sub-interface of _____________?

Correct! Wrong!

Configuration metadata comprising of instructions for instantiating, configuring and assembling objects can be represented using __________

Correct! Wrong!

Spring IOC container requires which of the following to create fully configured system?

Correct! Wrong!

Spring configuration can be defined using Java-based configuration which uses ___________ annotated methods within a ____________ class

Correct! Wrong!

It is mandatory to supply a name or id for a bean.

Correct! Wrong!

As a best practice, it is recommended to use ____________ for manadatory dependencies and ___________ for optional dependencies?

Correct! Wrong!

Beans can be instantiated using which of the following methods?

Correct! Wrong!

By default, ApplicationContext implementations eagerly create and configure all singleton beans as part of the initialization process.

Correct! Wrong!

It is possible to initialize beans in lazy manner, e.g., create bean instance when it is first requested, rather than at startup.

Correct! Wrong!

Spring does not support singleton bean use / invoke non-singleton (prototype) bean

Correct! Wrong!

Which of the following bean scope is only valid in the context of web-aware Spring ApplicationContext

Correct! Wrong!

Which of the following bean scope is only valid in the context of web-aware Spring ApplicationContext

Correct! Wrong!

Which of the following bean scope results in the creation of a new bean instance every time a request for that specific bean is made.

Correct! Wrong!

ApplicationContext implementation such as ____________ is required to avail bean scope such as application.

Correct! Wrong!

Which of the following binds the HTTP request object to the Thread that is servicing that request?

Correct! Wrong!

Beans created in application scope is similar to which of the scopes?

Correct! Wrong!

Spring Framework Interview Questions and Answers - Set 1
You did extremely well!!
You did reasonably well!!
Better luck next time!!

Share your Results:



Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. For latest updates and blogs, follow us on Twitter. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking. Check out my other blog, Revive-n-Thrive.com

Recent Posts

Linear Regression T-test: Formula, Example

Last updated: 7th May, 2024 Linear regression is a popular statistical method used to model…

11 hours ago

Feature Engineering in Machine Learning: Python Examples

Last updated: 3rd May, 2024 Have you ever wondered why some machine learning models perform…

5 days ago

Feature Selection vs Feature Extraction: Machine Learning

Last updated: 2nd May, 2024 The success of machine learning models often depends on the…

5 days ago

Model Selection by Evaluating Bias & Variance: Example

When working on a machine learning project, one of the key challenges faced by data…

6 days ago

Bias-Variance Trade-off in Machine Learning: Examples

Last updated: 1st May, 2024 The bias-variance trade-off is a fundamental concept in machine learning…

6 days ago

Mean Squared Error vs Cross Entropy Loss Function

Last updated: 1st May, 2024 As a data scientist, understanding the nuances of various cost…

6 days ago