Spring Framework Interview Questions & Answers – Set 1

Spring framework interview questions and answers

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)




Table of Contents

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
Follow me

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
Posted in Interview questions, Java, Web. Tagged with , , .

Leave a Reply

Your email address will not be published. Required fields are marked *