These Spring Interview Questions have been designed specially to get you
acquainted with the nature of questions you may encounter during your interview for the subject
of Spring. As per my experience good interviewers hardly plan to ask any particular question
during your interview, normally questions start with some basic concept of the subject and later
they continue based on further discussion and what you answer:
What is Spring?
Spring is an open source development framework for enterprise Java. The core features of the
Spring Framework can be used in developing any Java application, but there are extensions for
building web applications on top of the Java EE platform. Spring framework targets to make J2EE
development easier to use and promote good programming practice by enabling a POJO-based
programming model.
What are benefits of using spring?
Following is the list of few of the great benefits of using Spring Framework:
- Lightweight: Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 2MB.
- Inversion of control IOC: Loose coupling is achieved in spring using the technique Inversion of Control. The objects give their dependencies instead of creating or looking for dependent objects. Aspect oriented AOP: Spring supports Aspect oriented programming and enables cohesive development by separating application business logic from system services.
- Container: Spring contains and manages the life cycle and configuration of application objects.
- MVC Framework: Spring's web framework is a well-designed web MVC framework, which provides a great alternative to web frameworks such as Struts or other over engineered or less popular web frameworks.
- Transaction Management: Spring provides a consistent transaction management interface that can scale down to a local transaction usingasingledatabase, forexample and scale up to global transactions usingJTA, forexample.
- Exception Handling: Spring provides a convenient API to translate technology-specific exceptions thrownbyJDBC, Hibernate, orJDO, forexample into consistent, unchecked exceptions.