J2EE Interview Questions and Answers

Blog Author


Published Date

16th April, 2021




  • Share this blog :

J2EE Interview Questions and Answers

Looking to grab the job opportunities in the multinational organizations into J2EE? Then, you are at the right place. According to one of the surveys in recent times, it is known that J2EE holds a market share of 7.0% which is amazing. Hence, looking for opportunities around this technology is also worthy. In this article, you will review the J2EE interview questions asked during the interviews by different organizations. These frequently asked interview questions are curated by experts and I would recommend you to give a quick review on them which would help you crack the interview easily. Let’s get started now!

Most frequently asked J2EE Interview Questions

Q1) Briefly explain about J2EE?

Ans: J2EE stands for Java 2 enterprise edition. J2EE is one of the platforms that consists of the specifications and practices which will help in enabling the solutions for the development, deployment and management of the applications. J2EE is a flexible platform that allows the addition of the capabilities that are required to ensure that a robust and stable platform is provided at the enterprise level.  In simple terms, J2EE is a platform that is a combination of different protocols, APIs, services, etc.

Q2) What do you understand by the term J2EE module? Also, list out the different modules available in J2EE?

Ans: J2EE is referred to as the software unit that includes one or more J2EE components for the same container type along with one deployment descriptor of that type. The process of deploying and assembling the modules is easier in J2EE. There are 4 different types of J2EE modules. They are:

Application client module: The application client module consists of the class files and the client deployment descriptor. The application client module is packed as JAR files with an extension called .jar.

Web module: The web module consists of four components called Java Server Pages (JSP) files, class files for the servlets, web deployment descriptor and Graphical Interchange Format (GIF) and Hypertext markup language (HTML) files. These components or modules will be packaged under the JAR files with the .war extension.

Enterprise JavaBeans Module: The enterprise JavaBeans module consists of the class files for enterprise bans and also an EJB deployment descriptor. These modules or components are packaged as JAR files with .jar extension.

Resource Adapter Module: The resource adapter module comprises different concepts of java interfaces, resource adapter deployment descriptor, classes, native libraries, and other documentation.

Q3) Give a brief idea about the design goals of the J2EE architecture?

Ans: Below listed are the design goals of the J2EE architecture.

Accessibility: The application has to be designed in such a way that it is capable of allowing the user to connect from any kind of device from anywhere around the globe.

Data connectivity: The application should be capable of connecting to the mainframe systems and any other legal systems to make sure that the business functions are running as usual without any issues.

User interaction: The application has to be designed in such a way that the user is allowed to connect to the application using different devices like laptop, desktop, mobile phones, PDA, etc.

Service availability: We need to ensure that the application is available 24*7. There will be a dependency on the application without the need of the customer service agents.

Flexibility: The architecture has to be designed in such a way that the developer focuses on the business components and the other services will be handled by the server.

Want to acquire industry skills and gain complete knowledge of J2EE? Enroll in Instructor-Led live "J2EE Training" to become Job Ready!

Q4) Define the term JSF?

Ans: JSF stands for Java Server Faces, referred to as a user interface designing framework that is used for the development of web applications. There are a set of reusable components that are associated with the java server faces. JSF is based on the MVC (model view controller) patterns and designs.

Q5) What do you understand about the term hibernate and briefly list out the advantages of hibernate?

Ans: Hibernate is referred to as the open-source object-relational mapping and query service. It is possible to use HQL instead of SQL in Hibernate which will help the developers to save time and invest more time in writing the native SQL.  Hibernate is capable of using inheritance, polymorphism, collections, composition, association. Apart from this, it is also considered as one of the beautiful approaches which help in persisting to the database by making use of the java objects.  It is one of the platforms that will help you to express their queries by making use of the Java-based criteria.

Below are the advantages of using hibernate:

1. Hibernate is one of the portable platforms that are independent of the database and also independent of the vendor.

2. It includes a standard or a which is also providing support to JPA.

3. It also allows the mapping of the domain object to the relational database system.

4. When compared with the plain JDBC, Hibernate is very far better.

Q6) Briefly explain the differences between saving and save or update?

Ans: save(): The save()  method is used in Hibernate in order to store the objects in the database. Apart from this, it also helps you to insert an entry if the record does not exist in the database.

saveorupdate(): The saveorupdate()  method is used in Hibernate for updating the object using the identifier. If there is no identifier or if the identifier is missing this method with call save(). If the identifier exists, then it will call the update method.

Q7) What do you understand by the term ORM and also list out the benefits of ORM?

Ans: ORM refers to the object-relational mapping. The objects that are used in a java class will be mapped to the tables that are present in a relational database by making use of the metadata which will describe the mapping that exists between the object and the database. The object-relational mapping allows you to transform the data from one representation to another. Below listed are the set of advantages of ORM.

1. Vendor Independence

2. Productivity

3.  Performance

4. Maintainability

Q8) Can you tell me the different types of J2EE clients? Also, explain what is considered a web component?

Ans: There are four different types of J2EE clients. They are:

1. Application clients 

2. Java Web start enabled clients

3. Wireless clients

4. Applets

Java server pages and Java servlet Technology components are considered web components. Servlets are the Java programming language that will be dynamically receiving the request and make responses accordingly. The Java server pages will be executed as a servlet which will be a natural approach that will help in creating the static content.

Q9) What do you understand by the term hashtable?

Ans: Hashtable is similar to the hashmap which is a collection that has unique key and value pairs. Hashtable is considered as a collection synchronized object which will not allow duplicate values or null values.

Q10) List out the limitations of Hibernate?

Ans: Below is the set of limitations of Hibernate.

1. Hibernate is very slow in creating the queries when compared to the execution of the query that is used directly.

2. It does not include any shared preferences for the value type.

3. It is only flexible to provide the query language support for the composite keys.

Q11) Give a brief idea about the struts in the J2EE framework?

Ans: A struct is usually referred to as an application development framework that is based on the model view controller architecture. It includes the combination of the custom tags, messages, java servlets and JSP. It also allows you to design applications for large companies or organizations. It can be briefly described as below:

Model: A Model refers to the internal state of the system. It is based on the app architecture and can be either single or a cluster.

View: In order to design a view for the application, JSP technology is used.

Controller: A controller is specifically used to perform the management of the user actions. It is responsible for processing the client requests and respond to them same accordingly. The servlet of the class ActionServlet is referred to as the primary component in the framework. The configuration of the servlet is based on the definition of the set of action mappings.

Q12) What do you understand by the term authorization and authorization constraint?

Ans: Authorization: An authorization is referred to as a process of identifying access to the method or the resource. It also helps you in determining whether the principle associated with the request through the authentication is within the security role or not. A deployer is responsible for mapping the security roles to the security identities. Security identities here refer to the groups or the principles that are available in the operational environment.

Authorization constraint: An authorization constraint is referred to as an authorization rule that will help you in identifying who is allowed to access the web resource collection.

Q13) Briefly explain the concept of connection pooling?

Ans: Connection pooling is a simple concept or practice that is commonly used for reusing the already existing connections. Whenever there is a requirement of connections and if the object already has the well-defined connections, then these connections can be reused instead of creating or generating a new connection.

Q14) List out the core interfaces of hibernate framework?

Ans: Below listed are the core interfaces of hibernate framework:

  • Session interface
  • SessionsFactory interface
  • Transaction interface
  • Configuration interface
  • Query and Criteria interface

J2EE Design Patterns Interview Questions

Q15) Briefly explain the different components in the multi-tier architecture?

Ans: Below is the main components in the multi-tier architecture.

Presentation tier: The presentation tier is the front end component that is specifically used for displaying the presentation.

Resource tier: The resource tier is referred to as the back end component that is used for communicating with the database.

Business tier: The business tier is specifically used to provide the business logic for the system.

Q16) List out the different modules available in the spring?

Ans: Below is the list of the modules that are available in the spring.

  • DAO module
  • Aspect-oriented programming
  • MVC module
  • Web module
  • Core container module
  • O/R mapping module
  • Application context module.

Q17) Give a brief idea on servlet?

Ans: A servlet is referred to as a server-side component which is providing a powerful mechanism for the development of server-side programs. Servlets is called a server that is platform-independent, designed for different protocols. Among the different protocols available, HTTP protocols are the most commonly used. The servlets make use of the classes available in the java packages. All the servlets are capable of implementing the servlet interface which includes the defined life-cycle methods. Servlet is a pure java object.

Q18) List out the different phases in the servlet life cycle?

Ans: Below is the list of different phases in the servlet life cycle.

  • Servlet class loading
  • Servlet instantiation
  • The init method
  • Request handling
  • Removal from the service
Related Article: J2EE Tutorial

Q19) Explain JTA, JNDI and JMS?


JTA: JTA refers to Java Transaction API. The Java transaction API is responsible for managing and coordinating the transactions in the enterprise information system.

JNDI: JNDI refers to Java Naming Directory Interface. It is used for accessing the information that is required from the directory services.

JMS: JMS refers to Java Messaging Service. The java messaging service is responsible for sending and receiving messages using the different messaging systems.

Q20) Briefly explain the terms: EAI and EDI?


EAI: EAI refers to Enterprise Application Interface. EAI will help in making one or more applications into a single application and also helps in transmitting the required data to the appropriate system at the right time. Let us take an example of two different systems: sales and account systems. The sales team has to send the sales order to the accounting teams in order to generate the invoice. The accounting team has to then send the invoices to sales in order to update the data.

EDI: EDI stands for Electronic Data interchange. EDI helps in performing the exchange of the data via the value-added network which will be considered as the transmission medium. EDI requires customization by exchanging the clients and EDI is also expensive. EDI depends on the X12 standards to perform the interchanging of the documents.

Q21) Briefly explain the different roles of the third-party software in the EJB framework?


Component provider: The component provider is involved in the development of the programming, modelling, architecture, business processes, etc.

Container provider: The container provider is responsible for providing the environment during the runtime to the server.

application server provider: The application server provider is responsible for providing a platform that will help in the development of the distributed applications. It also consists of the container which is involved in providing the runtime environment.

Q22) Briefly explain the differences between load() and get()?

Ans: The load() method will be throwing an exception whenever the object is not existing either in the cache or the database. The load() method does not return any null values.

The get() will return the null when the object is not available either in the cache or the database.

Q23) Briefly list out the advantages of utilizing spring for the development of the applications?

Ans: The following are the advantages of using spring for the development of the applications.

The developmental costs can be reduced by ensuring that the productivity of the application development is improved.

It also helps in improving the maintainability and testability of the application by using the dependency injection along with reduced code coupling.

It allows the reuse of the existing components, saving the developers time.

It is not required to have an application server and is capable of working on the enterprise service.

Q24) Do you know the different types of JSP tags?

Ans: Below are the four different types of JSP tags available. They are:

  • Declarations
  • Directives
  • Scriptlets
  • Expressions

Q25) Give a brief description of the secure socket layer or SSL?

Ans: SSL or Secure socket layer is referred to as a technology that is helpful for establishing communication between the web browser and web server. It is also referred to as a protocol that helps us understand how the algorithms are designed to be used in encryption. It is responsible for establishing a link between the two different parties. This link will be used for the secured transmission of the information. Secure or sensitive information could be card information, social security numbers, login credentials, etc.

Q26) What do you know about EJB? List out the different basic and subtypes of the EJB?

Ans: EJB stands for Enterprise Java Beans. EJB  is referred to as a server-side container that performs the execution in the EJB container and is responsible for encapsulating the business logic for the application of the enterprise.

There are two main types in EJB with different subtypes as well.  They are listed below.

  • Session Beans
  • Stateful session beans
  • Stateless session beans
  • Entity beans
  • BMP -Bean Managed Persistence
  • CMP - Container-Managed Persistence
  • Message-driven beans

Q27) What do you understand by the term JSP directive? List out the different types of JSP directives available?

Ans: JSP directive is referred to as a mechanism that is responsible for providing the metadata information to the web containers with respect to the JSP file. The metadata is used by the web container during the compilation and translation phases of the JSP lifecycle.

Below are the three different types of JSP directives.

  • Page directive
  • Include directive
  • Taglib directive

J2EE Interview Questions For Senior Developers

Q28) Give a brief idea about HQl and Hibernate proxy?

Ans: HQL stands for Hibernate Query Language. The HQL language provides the users with the flexibility to express their queries through the portable SQL extension. It also provides the flexibility to the user to express in native SQL.

Hibernate Proxy: Hibernate proxy is referred to as the object proxy that includes the way or process to avoid retrieving the object unless and until you need it. By default, Hibernate 2 is not capable of providing the proxy objects.

Q29) Briefly give an idea about a thin client?

Ans: A thin client is referred to as a program interface to the application that does not include any operations like the execution of the business rules which are complex, querying of the databases, establishing connections to the legacy applications.

Q30) What do you understand by the term URN?

Ans: URN refers to Uniform Resource Name. URN refers to a unique identifier that is responsible for identifying an entity. The information about the entity location will not be available.

Q31) What are J2EE and the types of components used in the J2EE Application?

Ans: It is Java 2 Enterprise Edition. This is based on Application programming interfaces(APIs), a set of services and protocols.

Types of components:

  • Business components.
  • JSP Technology and servlets are web components.
  • Application client's components.
  • Resource Adapter components.

Q32) Define Spring?

Ans: Spring is used for the development of enterprise application in an open-source framework, that solves the complexity of enterprise application development, which is primarily based on inversion control or dependency injection design pattern.

Q33) What are the uses of spring?

Ans: Dependency injection can be used to improve testability. It decreases coupling in code and increases maintainability. Increase productivity and subsequently decreases the development cost. Spring required enterprise services without the need for an expensive application server.

Q34) What are the different phases included in the life cycle of a servlet?

Ans: Servlet installation. Request handling The init method Removal from the service. Servlet class loading.

Q35) What must be executed by servlets?

Ans: A servlet interface must be executed by all servlets.

Q36) Is Servlet a pure java object or not?

Ans: Yes, it is a pure java object.

Q37) What is the method to create objects without using the keyword “new” in java?

Ans: Yes, we can create objects without using new, here is an example:

Q38) C is Calender and method is getting Instance()

Ans: Calendar c=Calender.getInstance();

Q39) What is the scope of default in spring?

Ans: Singleton

Q40) Differentiate the types of modules in spring?

Ans: 7 types of are there in spring, they are:

  • DAO module.
  • Web module
  • Application context module
  • MVC module
  • The core container module
  • Aspect-oriented programming
  • O/R mapping module.

Q41) Define Ear File?

Ans) The modules in the J2EE Application are delivered by EAR File. it is nothing but an extension file, like a .ear extension.

Q42) List out the collection types in HIbernate?

Ans: Bag, Map, Array, Set, and List.

Q43) List out, JSP Tag?

Ans: There are 4 JSP tags, they are Expressions. Scripts. Declarations Directives.

Q44) Differentiate between war, jar, and ear files?

Ans: Ear files are the. ear extension files used in EJB modules of applications. War files are .war extensions and contains javascript, Html, JSP, etc.These are used for web application development Jar files are .jar extensions and contains accessories, resources, and libraries. These are used for property files.

Q45) What are the uses of ORM?

Ans: Vendor independence Performance Maintainability Productivity.


As you know that is a high demand for developing the applications as the customers are expecting new evolvements and enhancements. Business organizations are keeping up their efforts by ensuring that they are choosing the right language for the implementation of their projects or developments. Hence, looking for individuals who are expertized or knowledgeable has become common these days. And I know you are trying to crack the interview and grab one of the positions. These interview questions will definitely help you in cracking the interview. I wish you all the best for the interview and also for your future endeavours.

About Author


Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .

Related Blogs

Write For Us