J2EE Interview Questions

Q 01: What is J2EE? What are J2EE components and services? 
A 01: J2EE (Java 2 Enterprise Edition) is an environment for developing and deploying enterprise applications. The J2EE platform consists of J2EE components, services, A pplication Programming Interfaces (APIs) and protocols that provide the functionality for developing multi-tiered and distributed Web based applications.

J2EE

Q 02: Explain MVC architecture relating to J2EE? 
A 02: This is also a very popular interview question. MVC st ands for Model-View-Controller architecture. It divides the functionality of displaying and maintaining of the data to minimise the degree of coupling (i.e. promotes loose coupling) between components.

mvc

Q 03: What is the difference between a Web server and an application server? SF
A 03:
Web Server
Supports HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page (static content) or delegates the dynamic response generation to some other program such as CGI scripts or Servlets or JSPs in the application server.

Uses various scalability and fault-tolerance techniques.

Application Server

Exposes business logic and dynamic content to the client through various protocols such as HTTP, TCP/IP, IIOP, JRMP etc.

Uses various scalability and fault-tolerance techniques. In addition provides resource pooling, component life cycle management,
transaction management, messaging, security etc.

Provides services for components like Web container for servlet components and EJB container for EJB components.
Q 04: What is the difference between CGI and Servlet? SF
Q 04:
Traditional CGI
(Common Gateway Interface)

Traditional CGI creates a heavy weight process to handle each http request. N number of copies of the same traditional CGI programs is copied into memory to serve N number of requests.

Java Servlet

Spawns a lightweight Java thread to handle each http request. Single copy of a type of servlet but N number of threads (thread sizes can be configured in an application server).

In the MVC architecture, servlets process requests and select JSP views. So servlets act as controller. Servlets intercept the incoming HTTP requests from t he client (browser) and then dispatch the request to the business logic model (e.g. EJB, POJO – Plain Old Java Object, JavaBeans etc). Then select the next JSP view for display and deliver the view to client as the presentation (response). It is the best practice to use Web tier UI frameworks like Struts, JavaServer Faces etc, wh ich uses proven and tested design patterns.

Advertisements

One thought on “J2EE Interview Questions

  1. You share interesting things here. I think that your blog can go viral easily, but
    you must give it initial boost and i know how to do
    it, just search in google for – wcnu traffic increase

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s