Tell me about yourself

Tell me about yourself


Most of the interviewers ask us to 'tell me about yourself ' and the way you tell about your past projects, roles, and your background could be an icebreaker. If they like it there are 70% chances of getting hired.


Best ways to answer are:

      1. Attempt confidently

Yes, you heard it right!! Tell very confidently, because lack of confidence rises a doubt about your background. If the candidate isn’t confident how can your team and manager trust you?? Not possible right. So go with confidence.


Spring Questions

  • What is Spring Beans??

Java Objects which form the backbone of Spring application and they are assembled, instantiated, and managed by Spring IoC container.

These beans are created with configuration metadata that is supplied to the container, for instance, in the XML <bean/> form definitions.


  • How to provide configuration metadata to the Spring Container?

3 important methods to provide configuration metadata to the Spring Container :

    • Annotation-based configuration
    • Java-based configuration
    • An XML based configuration file

  • Explain the different types of bean scopes supported by Spring?

There are 5 different scopes provided by the Spring Framework:
    • Prototype scope, a single bean definition has any number of object instances.
    • Singleton scope, Spring scopes the bean definition to a single instance per Spring IoC container.
    • Request scope, a bean is defined to an HTTP request. This scope is valid only in a web-aware -Spring ApplicationContext.
    • Session scope, a bean definition is scoped to an HTTP session. This scope is also valid only in a -web-aware Spring ApplicationContext.
    • Global-session scope, a bean definition is scoped to a global HTTP session. This is also a case used in a web-aware Spring ApplicationContext.

  • Is Singleton class thread safe in Spring?
    NO


  • Explain Bean lifecycle in Spring framework

The spring container finds the beans definition from XML file, and instantiates the bean and also Spring populates all the properties specified in the bean definition (DI).

    • If the bean implements BeanNameAware interface, spring passes the bean’s id to setBeanName() method.
    • If Bean implements BeanFactoryAware interface, spring passes the bean-factory to setBeanFactory() method.
    • If there are any bean BeanPostProcessors associated with the bean, Spring calls postProcesser beforeInitialization() method.
    • If the bean implements IntializingBean, its afterPropertySet() method is called.
    •  If the bean has init method declaration, the specified initialization method is called.
    • If there are any BeanPostProcessors associated with the bean, their postProcessAfterInitialization() methods will be called.
    • If the bean implements DisposableBean, it will call the destroy() method.


What happens when you click on SUBMIT button [Spring MVC]

What happens when you click on SUBMIT button 

[Spring MVC] ??



1. When you click on submit the request goes to web.xml
2. Spring has a special servlet called as dispatcher servlet[front controller] 
3. From dispatcher servlet, it will go to the corresponding Controller
4. From controller, it redirects to business object and performs validations 
                              if it passes all the validation it goes to Data access layer 
                              else returns back to the user
5. From DAO it goes to DB 


 Dispatcher servlet  >> vo >> controller >> BO             >>                  DAO  >>  DB                                                                          Validations                                                                         if pass goes to DAO



Dependency Injection

Dependency Injection:


  • DI is a technique where 1object (or static method) supplies dependencies for other objects.i.e. Passing the service to the client, rather than client building the service himself.
  • It is done so that your code can be re-used and can be loosely coupled.
Why to Use Dependency Injection ??

Spring Introduction

Spring:


  • It was developed in 2003 by ROD JOHNSON.
  • It makes easy for the development of JAVAEE application.
  • Spring is a LightWeight framework. It supports other multiple frameworks like JSF, Struts, Hibernate etc.


           Before getting started more about Spring framework is important to know about DI [Dependency Injection and Inversion of control]