Spring - Interview Questions and Answers for 'Framework' | 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

   



Spring - Interview Questions and Answers for 'Framework' - 34 question(s) found - Order By Rating

next 30
 Q1. What are the benefits of using UI framework like Angular , View js etc instead of plain vanilla js and html ?Javascript
Ans. These frameworks facilitates easier product development and enhancement and maintainability by having separation of concerns ( using oops ) and helps in development of reusable libraries / components. So in nutshell , they make development and maintenance of large scale application easier.

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

   Like         Discuss         Correct / Improve     Javascript Frameworks  Angular  View js


 Q2. Can you explain integration between Spring and Hibernate ?Hibernate
 This question was recently asked at 'HCL 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 framework  Hibernate Orm     Asked in 1 Companies


 Q3. Difference between spring and spring bootSpring Framework
Ans. Spring is a Framework where we have to Build the Configurations Manually but Springboot have default configurations that allow faster bootstrapping. Spring Framework requires a number of dependencies to create a web app. Spring Boot, on the other hand, can get an application working with just one dependency.

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

   Like         Discuss         Correct / Improve     spring boot     Asked in 1 Companies


 Q4. what is dispatcher servlet@componentScan use ?Spring Framework
Ans. @ComponentScan in a Spring Application.

With Spring, we use the @ComponentScan annotation along with the @Configuration annotation to specify the packages that we want to be scanned. @ComponentScan without arguments tells Spring to scan the current package and all of its sub-packages.

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

   Like         Discuss         Correct / Improve     ComponentScan  dispatcher  @ComponentScan annotation  @Configuration annotation     Asked in 1 Companies


 Q5. What does the following code

MockitoAnnotations.initMocks(this);
Mockito
Ans. Initializes objects annotated with Mockito annotations

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

   Like         Discuss         Correct / Improve     mocking  java mocking frameworks  Mockito


 Q6. Which validation frameworks have you worked on ?Frameworks
 This question was recently asked at 'Sofi'.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     validation frameworks     Asked in 1 Companies


 Q7. What is Executor Framework in Java?
 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     executor framework


 Q8. Name few View frameworks you have worked with.Frameworks
Ans. JSF, Apache Wicket and Apache Velocity

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

   Like         Discuss         Correct / Improve     view framework


Frequently asked Spring interview question.
 Q9. 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


 Q10. Can you name some of the Java frameworks in different domains ?Frameworks
Ans. Web Framework - Spring , Struts, Play
Dependency Injection frameworks - Google Guice , PicoContainer and Dagger
ORM Framework - Hibernate
Big Data / ETL Frameworks - Apche Hadoop , Apache Crunch, Apache Spark.
View Frameworks - JSF , Apache Wicket,jtwig.
Java Gui Frameworks - SWT , AWT, JavaFX
Testing - Junit, Mockito, PowerMock, EasyMock, JMock, JMockit
Rest Web services - Jersey , Restlet , RestX, RestEasy ,Restfulie

Here is the big list for reference - http://javasearch.buggybread.com/home2.php?keyword=

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

   Like         Discuss         Correct / Improve     frameworks     Asked in 2 Companies      intermediate        frequent


 Q11. What is Hadoop Framework ?BigData
Ans. Hadoop is an open source framework , written in java by apche software foundation. This framework is used to write applications to process vast amount of data. Processing happens in parallel on large clusters which could have 1000 of computers. It processes data in a very reliable and fault tolerant manner.

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

   Like         Discuss         Correct / Improve     Hadoop framework  BigData


 Q12. What are the benefits of using Spring Framework ?Spring
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 is 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

  Sample Code for spring

 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     Asked in 2 Companies      basic        frequent


 Q13. Why Struts 1 Classes are not Thread Safe whereas Struts 2 classes are thread safe ?
Ans. Struts 1 actions are singleton. So all threads operates on the single action object and hence makes it thread unsafe.

Struts 2 actions are not singleton and a new action object copy is created each time a new action request is made and hence its thread safe.

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

   Like         Discuss         Correct / Improve     java   j2ee   mvc frameworks   struts   struts1   struts2   struts 1   struts 2   architecture

Try 1 Question(s) Test


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


Recently asked in TCS , Tech Mahindra, HCL , Accenture and Fidelity.
  Q15. Explain Flow of Spring MVC ?Spring
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     Asked in 11 Companies      Basic        frequent


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


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


 Q18. What bean scopes does Spring support? Explain them.Spring
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 Spring question.
  Q19. 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


Very frequently asked.Usually among first few questions.
  Q20. What is MVC ? Design
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application

1. Controller receives the requests and handles overall control of the request
2. Model holds majority of the Business logic, and
3. View comprise of the view objects and GUI component

 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     Asked in 60 Companies      basic        frequent

Try 1 Question(s) Test


Frequently asked in Phone Interviews.
 Q21. 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


 Q22. What is Hibernate ?Hibernate
Ans. Hibernate is a Java ORM Framework.

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

   Like         Discuss         Correct / Improve     hibernate   orm   frameworks   architecture


 Q23. Name few Java Mocking frameworks ?
Ans. Mockito, PowerMock, EasyMock, JMock, JMockit

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

   Like         Discuss         Correct / Improve     junit   mocking frameworks   mock   architecture   white box testing


 Q24. What are the steps to be performed while coding Junit with Mocking framework ?JUnit
Ans. Initialize required objects for working with mocks and tested method
Set the mock behaviour on dependent objects
Execute the tested method
Perform assertions
Verify if a method is invoked or not

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

   Like         Discuss         Correct / Improve     junit   mocking frameworks   mock   unit testing   java   white box testing  Mockito


 Q25. Name few Dependency Injection frameworks ?
Ans. Google Guice , Spring , PicoContainer and Dagger.

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

   Like         Discuss         Correct / Improve     dependency injection   di   frameworks   ioc


 Q26. Name some Java REST services frameworks ?Rest
Ans. Jersey , Restlet , RestX, Spring , RestEasy ,Restfulie, Play Framework

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

   Like         Discuss         Correct / Improve     java   rest   web services   frameworks


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


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


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


 Q30. What are some differences between Spring caching and Hibernate caching?Hibernate
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


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: