Spring Framework Interview Questions & Answers – Set 1

0

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?

____________ is a sub-interface of _____________?

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

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

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

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

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

Beans can be instantiated using which of the following methods?

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

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

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

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

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

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.

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

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

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




Ajitesh Kumar

Ajitesh Kumar

Ajitesh is passionate about various different technologies including programming languages such as Java/JEE, Javascript, PHP, C/C++, mobile programming languages etc, and, computing fundamentals related with cloud-native technologies, application security, cloud computing platforms, mobile apps, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.