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

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

next 30
 Q11. What are different modules of spring ?
Spring
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


 Q12. What is Spring configuration file?Spring
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     Asked in 1 Companies


 Q13. Q: What is default scope of bean in Spring framework?Spring
Ans. The default scope of bean is Singleton.

 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.
  Q14. What is bean auto wiring?Spring
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     Asked in 9 Companies        frequent


Frequently asked in Phone Interviews.
 Q15. What the Bean scopes provided by Spring ?Spring
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.
 Q16. What are the various Auto Wiring types in Spring ?
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


 Q17. When should we use prototype scope and singleton scope for beans ?Spring
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  singleton


 Q18. Which web application framework you like and Why ?Framework
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


 Q19. What is the difference betweeen @Inject and @Autowired ?Spring
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


 Q20. Should we have instance variables in the Spring Bean which has been scoped as Singleton ?Spring
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


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

a. BeanDefinition
b. ConfigurableBeanFactory
c. WebApplicationContext
d. All of the Above
Spring
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


 Q22. 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
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


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

a. Service
b. Model
c. Controller
d. Util
Spring
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


 Q24. What is Spring Boot ?Spring Boot
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     Spring Boot     Asked in 7 Companies


 Q25. What is Spring Security ?Spring
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          Asked in 3 Companies


 Q26. Explain your experience with Java, spring and web services?General
Ans. Have worked on Java 7 and Java 8, In Java 8 , Worked with streams , lambda expression and default methods.

Have worked on both Spring Mvc and Spring Boot, using Spring dependency injection, Rest services , AOP , JDBC and Hibernate integration.

Have worked on Rest services using Spring and Spring Boot. Have worked on SOAP web services too.

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

   Like         Discuss         Correct / Improve     spring  web services     Asked in 1 Companies


 Q27. Is there any relationship between Web.xml and Spring.xml ?Spring
Ans. No, there is no relationship between web.xml and spring.xml but you have to configure spring.xml in web.xml in order initialize beans when application starts up

 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     Asked in 1 Companies


 Q28. What are the advantages of Spring interceptor over Servlet Filters ?Spring
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


 Q29. Tell us something about Spring framework ?Spring
Ans. Spring is a lightweight framework which gives in-build DI(Dependency injection) and IOC(Inversion of control) features. Where DI is used for injecting one bean into the another bean like Inheritance in Java and IOC is a controller which will control the flow of the bean like bean creation and so on. We will use Bean Factory and Application Context for configuring.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


Frequently asked Spring interview question.
 Q30. What are the components of Spring framework ?Spring
Ans. Core: [Core, Bean, Context, Expression Language]

Web: [Web, Portlet, Servlet, etc]

Data Access [JMS, JDBC, etc]

AOP, Aspect

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

   Like         Discuss         Correct / Improve     spring  spring framework components     Asked in 12 Companies


 Q31. What are the core interfaces of Spring mvc ?Spring
 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


 Q32. Difference between MultipartResolver setMaxUploadSize and setMaxUploadSizePerFile ?Spring
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


 Q33. How to set maximum file upload size in Spring MVC ? Spring
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     


 Q34. Explain Spring invoke and wait.Spring
 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          Asked in 1 Companies


 Q35. Whats is the difference between Spring MVC and Spring Restful webservice ?Spring
 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          Asked in 1 Companies


 Q36. What is the use of @Bean annotation in Spring ?Spring
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


 Q37. What are the different ways in which dependency injection can be done using Spring Framework ?Spring
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


 Q38. Difference between constructor and setter injection ?Spring
Ans. 1. In Setter Injection, partial injection of dependencies can possible, means if we have 3 dependencies like int, string, long, then its not necessary to inject all values if we use setter injection. If you are not inject it will takes default values for those primitives1. In constructor injection, partial injection of dependencies cannot possible, because for calling constructor we must pass all the arguments right, if not so we may get error

2. Setter Injection will overrides the constructor injection value, provided if we write setter and constructor injection for the same property [i already told regarding this, hope you remember ] But, constructor injection cannot overrides the setter injected values

3. If we have more dependencies for example 15 to 20 are there in our bean class then, in this case setter injection is not recommended as we need to write almost 20 setters right, bean length will increase. In this case, Constructor injection is highly recommended, as we can inject all the dependencies with in 3 to 4 lines [i mean, by calling one constructor]

4. Setter injection makes bean class object as mutable [We can change ] .Constructor injection makes bean class object as immutable [We cannot change ]

 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     Asked in 3 Companies


 Q39. Difference between ApplicationContext and BeanFactory ?Spring
 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


 Q40. Explain inner beans in Spring.Spring
 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


next 30

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: