Java - Interview Questions and Answers for 'Spring' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Spring' - 48 question(s) found - Order By Newest

Recently asked in Accenture and Fidelity.
 Q1. Explain Flow of Spring MVC ?Spring
Admin
info@buggybread.com
Ans. The DispatcherServlet configured in web.xml file receives the request.

The DispatcherServlet finds the appropriate Controller with the help of HandlerMapping and then invokes associated Controller.

Then the Controller executes the logic business logic and then returns ModeAndView object to the DispatcherServlet.

The DispatcherServlet determines the view from the ModelAndView object.

Then the DispatcherServlet passes the model object to the View.

The View is rendered and the Dispatcher Servlet sends the output to the Servlet container.

Finally Servlet Container sends the result back to the user.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   architecture     Accenture  fidelity  IBM India      Basic        frequent


 Q2. What are the benefits of using Spring Framework ?Spring
Admin
info@buggybread.com
Ans. Spring enables developers to develop enterprise-class applications using POJOs. The benefit of using only POJOs is that you do not need an EJB container product.

Spring is organized in a modular fashion. Even though the number of packages and classes are substantial, you have to worry only about ones you need and ignore the rest.

Spring does not reinvent the wheel instead, it truly makes use of some of the existing technologies like several ORM frameworks, logging frameworks, JEE, Quartz and JDK timers, other view technologies.

Testing an application written with Spring is simple because environment-dependent code is moved into this framework. Furthermore, by using JavaBean-style POJOs, it becomes easier to use dependency injection for injecting test data.

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.

Spring provides a convenient API to translate technology-specific exceptions (thrown by JDBC, Hibernate, or JDO, for example) into consistent, unchecked exceptions.

Lightweight IoC containers tend to be lightweight, especially when compared to EJB containers, for example. This is beneficial for developing and deploying applications on computers with limited memory and CPU resources.

Spring provides a consistent transaction management interface that can scale down to a local transaction

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   spring framework   mvc   spring container   architecture   technical architect   java architect   technical lead  ioc     MasterCard


 Q3. How can we manage Error Messages in the web application ?Solution
Anonymous
Ans. Within message.properties file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   web application   struts   spring     Trimax IT Infrastructure


 Q4. Difference between Java beans and Spring Beans ?Spring
Admin
info@buggybread.com
Ans. Java Beans managed by Spring IoC are called Spring Beans.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   spring   beans


 Q5. What bean scopes does Spring support? Explain them.Spring
Admin
info@buggybread.com
Ans. The Spring Framework supports following five scopes -

Singleton
prototype
request
session
global-session

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   beans   beans scope   at&t  fidelity


Very frequently asked.Usually among first few questions.
  Q6. What is MVC ? Design
Anonymous
Ans. The Model/View/Controller pattern, a strategy for dividing responsibility in a GUI component.

The model is the data for the component.

The view is the visual presentation of the component on the screen.

The controller is responsible for reacting to events by changing the model.

According to the MVC pattern, these responsibilities should be handled by different objects.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   mvc   mvc design pattern   design pattern   struts   spring   web application   web frameworks   ebay     HCL Technologies  Tata Consultancy (TCS)  Wipro  United Health Group (UHG)  Accenture  Fidelity  Fidelity Investments   Tieto  Walt Disney  Sharon Software Systems  Tech Mahindra  Amdocs  Deegit  Lexis Nexis  Elsevier      basic        frequent

Try 1 Question(s) Test


 Q7. What are some differences between Spring caching and Hibernate caching?Hibernate
Admin
info@buggybread.com
Ans. Spring caching makes use of its intercepting capabilities to add caching to method calls. Therefore, the entire object is cached and reused. Hibernate, on the other hand, has more domain-specific knowledge of the Entity being cached and can handle the objects more appropriately.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring framework   hibernate   spring cache   hibernate cache


 Q8. Can we have two beans with same class with different bean id in spring ?Spring2016-10-18 14:18:43

Ans. Yes

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring beans     MagicBricks


 Q9. What are different modules of spring ?
Spring
Admin
info@buggybread.com
Ans. There are seven core modules in spring

Spring MVC
The Core container
O/R mapping
DAO
Application context
Aspect Oriented Programming or AOP
Web module

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. What is Spring configuration file?Spring
Anonymous
Ans. Spring configuration file is an XML file. This file contains the classes information and describes how these classes are configured and introduced to each other.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   spring configuration file     Bosch


 Q11. Q: What is default scope of bean in Spring framework?
Spring
Admin
info@buggybread.com
Ans. The default scope of bean is Sing leton for Spring framework.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   bean


Very Frequently asked Spring question.
  Q12. What is bean auto wiring?Spring
Admin
info@buggybread.com
Ans. The Spring container is able to autowire relationships between collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using and elements.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   autowiring   beans   at&t   ge     Infosys  HCL Technologies  Tata Consultancy  Wipro  PwC  Tech Mahindra  AT&T  General Electric  Sophos        frequent


Frequently asked in Phone Interviews.
 Q13. What the Bean scopes provided by Spring ?Spring
Admin
info@buggybread.com
Ans. Singleton , Prototype , Request , Session , global-session

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring framework   bean scope   general electric   ge


Frequently asked in Phone Interviews.
 Q14. What are the various Auto Wiring types in Spring ?
Admin
info@buggybread.com
Ans. By Name , By Type and Constructor.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   spring   spring container   dependency injection   auto wiring   auto wiring types   general electric   ge


 Q15. When should we use prototype scope and singleton scope for beans ?Spring
admin
info@buggybread.com
Ans. We should use singleton scope for beans when they are stateless and prototype when they are stateful.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring   bean scope   general electric   ge


 Q16. Which web application framework you like and Why ?Framework
Admin
info@buggybread.com
Ans. I like Spring as it comes with inbuilt Dependency Injection framework. It has great online community and support and is proven to work well with ORMs like Hibernate. If we are not working with ORM and DI, Struts 2 is also good.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring   struts   project lead   technical lead   techical architect


 Q17. What is the difference betweeen @Inject and @Autowired ?Spring
Admin
info@buggybread.com
Ans. @Autowired and @Inject are similar in terms of functionality they achieve. @Inject is part of a new Java technology called CDI that defines a standard for dependency injection whereas @Autowired is a Spring specific annotation for dependency injection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring   web frameworks   dependency injection   autowired   inject   spring annotations   ioc


 Q18. Should we have instance variables in the Spring Bean which has been scoped as Singleton ?Spring
Admin
info@buggybread.com
Ans. No, if required we should only have final variables.Bean scoped singleton means that only one instance of the bean will be created and will be shared among different requests and hence instance variables will get shared too.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   singleton   spring framework   spring beans


 Q19. Which class provides the enumerated value for Bean Scope ?

a. BeanDefinition
b. ConfigurableBeanFactory
c. WebApplicationContext
d. All of the Above
Spring
Anonymous
Ans. All of the Above

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring   spring beans   spring bean scope



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. Which of the following Interface needs to be implemented by any object that wishes to be notified of the ApplicationContext that it runs in ?

a. ApplicationContextAware
b. ApplicationContextUtils
c. ApplicationContext
d. Aware
Spring
Anonymous
Ans. ApplicationContextAware

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring   applicationcontext   application context   applicationcontextaware


 Q21. In Spring , Which class handles the Http requests for RESTful web services ?

a. Service
b. Model
c. Controller
d. Util
Spring
Anonymous
Ans. Controller

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring frmaework   spring mvc   rest   webservices


 Q22. What is Spring Boot ?Spring2016-12-19 06:23:21

Ans. Spring Boot is Springs convention-over-configuration solution for creating stand-alone, production-grade Spring-based Applications.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          JP Morgan Chase (JPMC)  Silver Search  Magna Infotech  General Dynamics  MphasiS  Narvar


 Q23. What is Spring Security ?Spring2017-01-10 09:13:58

Ans. Spring Security is a powerful and highly customizable authentication and access control framework. It is the de facto standard for securing Spring-based applications.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          Fidelity Investments  Anonymous Content  Istream Solutions


 Q24. Is there any relationship between Web.xml and Spring.xml ?Spring2017-01-11 09:13:48

 This question was recently asked at 'Fidelity National Information Services (FIS)'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  web.xml  spring.xml  deployment descriptor     Fidelity National Information Services (FIS)


 Q25. What are the advantages of Spring interceptor over Servlet Filters ?Spring2017-01-30 10:30:32

Ans. Spring Interceptor are Spring beans and hence they can inject other beans and can be used with other Spring frameworks concepts like AOP.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     interceptors  servlet filters  spring interceptors vs servlet filters


 Q26. Tell us something about Spring framework ?Spring2017-02-02 18:05:41

 This question was recently asked at 'OPNET'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          OPNET


 Q27. What are the components of Spring framework ?Spring2017-02-06 11:57:01

 This question was recently asked at 'Deloitte,NZone,L&T Infotech,Ocean Consulting'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  spring framework components     Deloitte  NZone  L&T Infotech  Ocean Consulting


 Q28. What are the core interfaces of Spring mvc ?Spring2017-03-09 13:13:56

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     core interfaces of Spring mvc


 Q29. Difference between MultipartResolver setMaxUploadSize and setMaxUploadSizePerFile ?Spring2017-03-09 14:34:30

Ans. setMaxUploadSize is used to set the maximum size of uploads that can be made in a request whereas setMaxUploadSizePerFile sets the maximum size per uploaded file.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     MultipartResolver



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q30. How to set maximum file upload size in Spring MVC ? Spring2017-03-09 14:35:54

Ans. We can use class MultipartResolver method setMaxUploadSize.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     


 Q31. Explain Spring invoke and wait.Spring2017-04-09 08:56:55

 This question was recently asked at 'TD Ameritrade'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          TD Ameritrade


 Q32. Whats is the difference between Spring MVC and Spring Restful webservice ?Spring2017-05-03 15:33:20

 This question was recently asked at 'CapTech'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          CapTech


 Q33. What is the use of @Bean annotation in Spring ?Spring2017-05-16 19:35:49

Ans. There are 2 ways to specify dependencies in Spring, one by the way of specifying beans in config files and other is by specifying annotations like @Bean, @Component , @Service etc to let spring know of the dependencies.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring bean annotation  spring annotations


 Q34. What are the different ways in which dependency injection can be done using Spring Framework ?Spring2017-06-23 11:48:58

Ans. Using Constructor and Setters.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  dependency injection   inversion of control


 Q35. Difference between constructor and setter injection ?Spring2017-06-23 11:49:27

 This question was recently asked at 'Sofi,HCL Technologies,Tata Consulancy (TCS)'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  dependency injection   inversion of control     Sofi  HCL Technologies  Tata Consulancy (TCS)


 Q36. Difference between ApplicationContext and BeanFactory ?Spring2017-06-23 11:50:50

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     ApplicationContext  BeanFactory   ApplicationContext vs BeanFactory        frequent


 Q37. Explain inner beans in Spring.Spring2017-06-23 11:51:53

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  spring beans   spring inner beans


 Q38. What are some limitations or dis advantages of Auto Wiring ?Spring2017-06-23 11:52:24

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  autowiring  spring auto wiring


 Q39. What are the types of transaction management supported by Spring ?Spring2017-06-23 11:53:17

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring  spring transaction management



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q40. What are the different ORMs supported by Spring ?Spring2017-06-23 11:53:37

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring orm


 Q41. What are the different types of advices in AOP ?Spring2017-06-23 11:54:01

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     spring app  spring  aspect oriented programming


 Q42. What is weaving in Spring ?Spring2017-06-23 11:54:32

 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Spring


 Q43. How to use spring boot to configure different datasources ?Spring2017-07-28 12:36:49

 This question was recently asked at 'Citigroup'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Spring Boot     Citigroup


 Q44. What are the disadvantages of Bean Auto Wiring in Spring ?Spring2017-08-04 09:16:31

Ans. It can always be overridden with explicit wiring. Moreover it's confusing if we use both explicit as well as explicit wiring in the project.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Spring beans  auto wiring  autowiring


 Q45. What is the difference between Singleton and Prototype Bean scope in Spring ?Spring2017-08-20 06:35:16

 This question was recently asked at 'Infosys Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Spring beans  singleton bean scope  prototype bean scope     Infosys Technologies


 Q46. how do you share data between JSP and spring controller using Angular JS ?AngularJS2017-09-07 07:02:47

 This question was recently asked at 'Axis Bank'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     angularjs  jsp  spring controller     Axis Bank


 Q47. Which of following is not Spring MVC annotation ?Spring
a. @Autowired
b. @Controller
c. @JoinColumn
d. @Transactional

Ans.c. @JoinColumn

 Q48. Spring MVC is a .. Spring
a. Model Framework
b. View Framework
c. GUI Framework
d. Web Framework

Ans.d. Web Framework



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

Spring Boot: Though there is bit of learning curve ... Amit

SPRING MVC: This is a great framework. I used ... Jina

SPRING MVC: This is indeed a great framework and ... Ajay

Spring WebFlow: Worked on this framework once in 2010. Ideally ... vivek

SPRING MVC: It has become de facto standard for ... Jayant

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: