Wednesday, August 29, 2012

Spring Interview Questions Answers | Spring MVC framework FAQ

Spring Interview Questions Answers 
Spring Interview Question is one of the first thing Java programmer should prepare before appearing on any Java or Spring interview. With growing popularity of Spring in Java world, Interview questions on Spring are getting more important day by day. For those who don't know, Spring framework is popular Java programming framework which not only provided dependency Injection and Inversion of Control but also provides useful API to Java programmers.While preparing Spring interview question focus on Spring core, Spring Security and Spring API, these are main areas from where interviewer ask questions. If you have working experience in Spring framework, you can easily answer most of Spring questions asked in Java interview but if you don't have any prior experience and just learning Spring, you need to not only prepare answers of these Spring questions but also some follow-up questions which stem from your answers.




Spring Questions and Answers

Spring Framework Interview Question Answers | Spring MVC FAQAnyway let's see frequently asked questions on Spring framework on Java interviews :

1) What is spring framework? Why Java programmer should use Spring framework
Very common Spring interview question, Spring is a framework which helps Java programmer in development. Spring provides dependency Injection and IOC container, Spring MVC flow and several useful API for Java programmer.

2) What is default scope of bean in Spring framework ?
default scope of bean is Singleton, you can read this article which explains about all possible scope of a spring bean : What is bean scope in Spring

3) Does Spring singleton beans are thread-safe ?
No, Spring singleton beans are not thread-safe. Singleton doesn't mean bean would be thread-safe.

4) What is dependency Injection?
5) What is Inversion of Controller?
6) What is Spring MVC ? Can you explain How one request is processed ?
7) How to you create controller in Spring ?
8) What is view Resolver pattern ? how it work in Spring MVC
9) What is Spring Security ?
10) How do you control concurrent Session on Java web application using Spring Security.
see this Spring Security example on How to control concurrent user session using Spring security

These were some of the Spring questions from My collection, I have given short answers for most of these Spring interview question. I suggest to research more or read along those Spring questoin to prepare for follow up Spring interview questions.

Other Interview questions and answer for Java programmer:
5 Thread interview questions answers in Java
10 Java Coding Interview questions and Answer
10 Advanced core Java interview questions
What are difference between wait and sleep in Java

7 comments:

  1. My list of Spring MVC interview question :

    Explain Spring MVC flow with a simple example e.g. starting from Container receives request and forward to your Java application ?

    What is difference in Spring MVC and Spring core?

    Can you use Spring MVC framework along with Struts ? I have an existing Java MVC application which is based in Struts, Can I migrate that to use Spring MVC ? How ?

    What is advantage of Spring MVC framework over Struts 1.0 or Struts 2.0 ? is it worth to convert an existing Struts application to Spring MVC ?

    How does Spring resolves view returned by ModelAndView class ?

    Some Spring MVC questions are tricky e.g. Struts and Spring integration and can be only answered by experienced Java program with 2 to 4 year experience in Spring MVC framework.

    ReplyDelete
    Replies
    1. Good questions Radhe. Inspired by you, I would also like to share few more Spring MVC question which I have seen on Spring Interviews :

      1)IF User checked in CheckBox and got validation error on otherfields and than he unchecked the CheckBox, what would be selection status in command object in Spring MVC ? How do you fix this issue ?
      Since during HTTP post, if checkbox is unchecked than HTTP does include a request parameter for checkbox, which means updated selection won't be picked up. you can use hidden form field, starting with _ to fix this in Spring MVC. quite tricky question to answer if you are not aware of HTTP POST behavior and Spring MVC.

      2) What are different implementation of View interface you have used in Spring MVC ?
      ULBased View e.g. JSP , JSTLView,

      3) How to escape HTML special characters using Spring MVC ?
      there are some methods in Spring tag library, can't remember now.

      Delete
  2. Nice answer bhaumik, Can't remember now!

    ReplyDelete
  3. Please explain what is difference between spring mvc and struts 2.0?

    ReplyDelete
  4. Does anyone know the answers to the other questions?

    ReplyDelete
  5. both are used for web layer but spring MVC provide extra features

    ReplyDelete
  6. Please explain Spring MVC Controllers what are the different Cotrollers available and how to use it.and how those better then struts Action classes.

    ReplyDelete

Java67 Headline Animator