Thursday, February 9, 2012

J2EE Interview Questions

The following are some questions you might encounter with respect to the J2EE Technology in any Interview for a Java J2EE Developer. The questions below are pretty exhaustive and practically speaking, you might not be asked most of the questions because - interviewers might prefer to test out your knowledge of core J2EE technologies like Servlets, JSPs, Struts, Hibernate etc. Nonetheless, there is nothing wrong in being prepared and the questions below would help you prepare for your J2EE Interview.

Questions:

1. What is J2EE?

J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitier, web-based applications.

2. What is the J2EE module?

A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.

3. What are the components of J2EE application?

A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:
* Application clients and applets are client components.
* Java Servlet and JavaServer Pages (JSP) technology components are web components.
* Enterprise JavaBeans (EJB) components are business components.
* Resource adapter components provided by EIS and tool vendors.

4. What does application client module contain?

The application client module contains:
*class files
*an application client deployment descriptor.

Application client modules are packaged as JAR files with a .jar extension.

5. What does web module contain?

The web module contains:
*JSP files,
*class files for servlets,
*GIF and HTML files, and
*a Web deployment descriptor.

Web modules are packaged as JAR files with a .war (Web ARchive) extension.

6. What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?

There are no structural differences between the files; they are all archived using zip-jar compression. However, they are intended for different purposes.

*Jar files are intended to hold generic libraries of Java classes, resources, auxiliary files, etc.
*War files are intended to contain complete Web applications.
*Ear files are intended to contain complete enterprise applications.

Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.

7. What is an applet?

A J2EE component that typically executes in a Web browser but can execute in a variety of other applications or devices that support the applet programming model.

8. What is applet container?

A container that includes support for the applet programming model.

9. What is application assembler?

A person who combines J2EE components and modules into deployable application units

10. What is application client?

A first-tier J2EE client component that executes in its own Java virtual machine. Application clients have access to some J2EE platform APIs.

11. What is application client container?

A container that supports application client components.

12. What is application client module?

A software unit that consists of one or more classes and an application client deployment descriptor.

13. What is application component provider?

A vendor that provides the Java classes that implement components' methods, JSP page definitions, and any required deployment descriptors.

14. What is application configuration resource file?

An XML file used to configure resources for a Java Server Faces application, to define navigation rules for the application, and to register converters, Validator, listeners, renders, and components with the application.

15. What is build file?

The XML file that contains one or more ant targets. A target is a set of tasks you want to be executed. When starting asant, you can select which targets you want to have executed. When no target is given, the project's default target is executed.

ant - is a tool that is used to build web applications

16. What is deployment?

The process whereby software is installed into an operational environment. For ex: deploying an EAR file into a Weblogic Server.

17. What is deployment descriptor?

An XML file provided with each module and J2EE application that describes how they should be deployed. The deployment descriptor directs a deployment tool to deploy a module or application with specific container options and describes specific configuration requirements that a deployer must resolve.

18. What is HTML?

Hypertext Markup Language. A markup language for hypertext documents on the Internet. HTML enables the embedding of images, sounds, video streams, form fields, references to other objects with URLs, and basic text formatting.

19. What is HTTP?

Hypertext Transfer Protocol. The Internet protocol used to retrieve hypertext objects from remote hosts. HTTP messages consist of requests from client to server and responses from server to client.

20. What is HTTPS?

HTTP layered over the SSL protocol. It is the secure version of the HTTP protocol

21. What is Java 2 Platform, Micro Edition (J2ME)?

A highly optimized Java runtime environment targeting a wide range of consumer products, including pagers, cellular phones, screen phones, digital set-top boxes, and car navigation systems.

22. What is JDBC?

An JDBC for database-independent connectivity between the J2EE platform and a wide range of data sources.

23. What is JNDI?

Abbreviate of Java Naming and Directory Interface. It is used as part of JDBC

24. What is query string?

A component of an HTTP request URL that contains a set of parameters and values that affect the handling of the request

25. What is resource adapter?

A system-level software driver that is used by an EJB container or an application client to connect to an enterprise information system. A resource adapter typically is specific to an enterprise information system. It is available as a library and is used within the address space of the server or client using it. A resource adapter plugs in to a container. The application components deployed on the container then use the client API (exposed by the adapter) or tool-generated high-level abstractions to access the underlying enterprise information system. The resource adapter and EJB container collaborate to provide the underlying mechanisms-transactions, security, and connection pooling-for connectivity to the enterprise information system.

26. What is Secure Socket Layer (SSL)?

A technology that allows Web browsers and Web servers to communicate over a secured connection.

27. What is URI?

Uniform resource identifier. A globally unique identifier for an abstract or physical resource. A URL is a kind of URI that specifies the retrieval protocol (http or https for Web applications) and physical location of a resource (host name and host-relative path). A URN is another type of URI.

28. What is URL?

Uniform resource locator. A standard for writing a textual reference to an arbitrary piece of data in the World Wide Web. A URL looks like this:
protocol://host/local info

where protocol specifies a protocol for fetching the object (such as http or ftp), host specifies the Internet name of the targeted host, and local info is a string (often a file name) passed to the protocol handler on the remote host.

29. What is URL path?

The part of a URL passed by an HTTP request to invoke a servlet. A URL path consists of the context path + servlet path + path info, where Context path is the path prefix associated with a servlet context of which the servlet is a part. If this context is the default context rooted at the base of the Web server's URL namespace, the path prefix will be an empty string. Otherwise, the path prefix starts with a / character but does not end with a / character. Servlet path is the path section that directly corresponds to the mapping that activated this request. This path starts with a / character. Path info is the part of the request path that is not part of the context path or the servlet path

30. What is URN?

Uniform resource name. A unique identifier that identifies an entity but doesn't tell where it is located. A system can use a URN to look up an entity locally before trying to find it on the Web. It also allows the Web location to change, while still allowing the entity to be found.

* * *


If you have any more questions on J2EE concepts that you have faced during your interviews and wish to add them to this collection - Please drop a note to me and I shall be glad to add them to this list.

No comments :

Post a Comment