0% found this document useful (0 votes)
553 views24 pages

Java/J2EE Interview Questions You'll Most Likely Be Asked

Java/J2EE Interview Questions You’ll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver’s seat and helps them steer their way to impress the interviewer.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
553 views24 pages

Java/J2EE Interview Questions You'll Most Likely Be Asked

Java/J2EE Interview Questions You’ll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver’s seat and helps them steer their way to impress the interviewer.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Java/J2EE Interview

Questions
Review these typical interview questions and think about how you
would answer them. Read the answers listed; you will find best
possible answers along with strategies and suggestions.
This page is intentionally left blank.
Chapter 1

Architectures and Protocols

1: What is the diff erence between a Web Server and an


Application Server?
Answer:
A Web Server works over the Internet. It uses the HTTP
protocol to send the client requests over the Internet on to the
server which is located elsewhere and retrieves the information
requested from the server or the posts the information sent on
the server. ASP, JSP, Servlets, server side Javascript and CGI
scripts work for the Web Server. The Web server simply acts as
the middle layer passing on the requests or retrieving the
requests and provides the HTML page results. It does not
involve in any processing or data handling. An Application
server provides the business logic to the client using the HTTP
or other protocols. The Application server can be a GUI which
involves some business logic or data processing programs
running on a computer, a web server or other application
servers. It exposes the business logic to the client.

2: What all technologies are included in the J2EE


architecture?
Answer:
The J2EE architecture includes the following technologies:
a) JAX RPC which is the Java API for XML based RPC
b) JSP or Java Server Pages
c) EJB or Enterprise Java Beans
d) Java Servlets
e) J2EE Connector Architecture
f) J2EE Management Model
g) J2EE Deployment API
h) JMX or Java Management Extensions
i) J2EE Authorization Contract for Containers
j) JAXR or Java API for XML Registries
k) JMS or Java Message Service
l) JNDI or Java Naming and Directory Interface
m) JTA or Java Transaction API
n) CORBA or the Common Object Request Broker
Architecture
o) JDBC which is the Java Data Base Connectivity API

3: What are the benefits of Springs?


Answer:
The Java Spring framework is an open source development
framework which can be used to create various sorts of Java
Applications including Web Servers. It consists of the JTA, EJB,
remote API, JDBC, JMX and JMS which makes the framework
perfect for creating all sorts of applications. The Spring
framework is a lightweight framework with respect to the size
and simplicity. The Spring framework supports Inversion of
control which enables loose coupling. It is based on Aspect
Oriented Programming or AOP which separates the business

provides a good alternative to other web frameworks. It also


provides JTA and Exception handling.

4: Diff erentiate between SAX and DOM Parsers


Answer:
Both SAX and DOM parsers are used to parse XML documents.
The major differences between SAX and DOM parsers are:
a) SAX means Simple API for XML and DOM means
Document Object Model.
b) The SAX parser parses the document one node at a time
whereas the DOM parser loads the entire document
into the memory first and then processes the node.
c) Since the SAX parses on the go, it does not use the
memory whereas the DOM uses the memory to store
the entire XML document.
d) We cannot modify the XML tree, cannot add or delete
nodes in SAX while using DOM we can.
e) SAX supports top to bo om traversing while DOM
supports all types of traversing.
f) SAX does not maintain comments while DOM
maintains comments
g) SAX parser is faster as it parses node by node and the
DOM parser is a li le slower since it loads the entire
XML document into the memory first and then parses
it.

5: What is the diff erence between a component and a service?


Answer:
A J2EE component is a smaller unit of application software
used for a particular purpose. Applets, Servlets, Session beans,
Entity beans WAR, JAR and resource adapters are all different
components of J2EE. A Service is in J2EE can be considered as
the next level to distributed component. It is a component that
can be used remotely synchronously or asynchronously. This
includes components such as the RPC, Messaging system,
Sockets and web services. A service should have a well-defined
service contract, is independent and self-contained.

6: What are the design goals of J2EE architecture?


Answer:
The following are the design goals of J2EE architecture:
a) Service Availability: The application should be
available 24*7. The business depends on the application
without the need for customer service representatives
b) Data Connectivity: The application should be able to
connect to mainframe systems and other legacy systems
to ensure business functions as usual
c) Accessibility: User should be able to connect the
application from anywhere and from any electronic
devices
d) User Interaction: The user should be able to connect to
the application from desktop, laptop, PDA, and mobile
e) Flexibility: The architecture should be created in such a
way that the developer just concentrates on the business
component model (business logic) and the rest of the
services are handled by the server

7: What are the roles of J2EE Architect?


Answer:
The following are the roles of J2EE architect:
a) Visualizing the behavior of the system
b) Creating the system blue print
c) Defining the way how the system elements work
together
d) Defining non-functional and functional requirements
e) Integrating non-functional requirements into the
functional system

8: What is the diff erence between architecture and design?


Answer:
Architecture defines the structural issues, communication
classification. It also defines the architectural design of the
component interfaces.
In Design, we define the components to be created for each
interface, the inputs, the outputs, algorithms, and data

internal details.

9: What are the activities performed in Architectural


Analysis?
Answer:
The following activities will be performed in Architectural
Analysis:
a) Use case diagram: This is developed to depict the high
level system functionality
b) Class Diagram: This is developed to depict the
functionality as classes and methods
c) Collaboration Diagram: This is developed to depict
how each class talk to each other
d) Sequence Diagram: This is developed to depict the
operation sequence

10: What are the activities performed in Architectural Design?


Answer:
The following activities will be performed in Architectural
Design:
a) The framework (example: Remote Method Invocation)
to be used will be decided
b) The software and hardware requirements are defined
c) The performance parameter and the approach to
achieve will be defined
d) Analyze for reusing existing components or technology
e) Define the business logic, security, and performance of
the system

11: What are the activities performed in the object oriented


design?
Answer:
The following activities will be performed in object oriented
design:
a) Decide on how classes interact with packages
b) Create dependency diagrams
c) Create deployment diagrams
d) Decide if the components (software) reside in
deployment folder

12: What are the components of multi-tier architecture?


Answer:
The following are the components of multi-tier architecture:
a) Presentation Tier: The front end component is present
in this tier which is used to display the presentation
b) Resource Tier: The back end component is present in
this tier which is used to communicate with database
c) Business Tier: The component present in this tier is
used to provide business logic for the system

13: What are the advantages of multi-tier client server


architecture?
Answer:
The following are the advantages of multi-tier client server
architecture:
a) Changes to business logic or user interface can be made
independently
b) The client accesses data easily without knowing where
data comes from and how many servers available for
the system
c) The DB (database) connections can be pooled so that the
data can be shared for several users without making DB
request for each user
d) The middle tier component (business logic) can be
wri en in any standard programming languages such
as C or Java

14: What are the responsibilities of the bean developer?


Answer:
The following are the responsibilities of the bean developer:
a) Write the systems business logic in java
b) Integrate java components with third party components
c) Control access and set transaction parameters
d) Create home interface to find the beans and remote
interface to create business logic
e) Create the deployment descriptor xml

15: What are the responsibilities of application assembler?


Answer:
The following are the responsibilities of application assembler:
a) Build presentation layer i.e., user interface
b) Specify the requirements of transaction management
c) Set transaction parame
d) Define security roles and assign permissions
e) Specify wild card character (*) to the methods

16: What are the responsibilities of bean deployer?


Answer:
The following are the responsibilities of bean deployer:
a) Map fields to DB (database) columns and manage
persistence
b) Define users, groups, roles, and manage security
c) Use the deployment tools and generate wrapper classes
d) Map user roles and groups
e) Ensure all the deployed bean is assigned a transaction
parameter

17: What are the roles of third party software in EJB


framework?
Answer:
The third party companies that provide the software can play
any of the following three roles:
a) Component Provider: Responsible for developing
object modeling, programming, architecture, and
business process
b) Container Provider: Responsible for proving the
environment during runtime to the server
c) Application Server Provider: Responsible for
providing platform to develop distributed applications.
It usually contains the container which provides the
runtime environment

18: Explain MVC architecture.


Answer:
MVC represents Model View Controller architecture. The
activity performed in MVC is explained below:
a) In Model, the developer creates the business logic of the
system
b) In View, the developer creates the presentation logic
c) In Controller, the developer receives the request and
transfers the response

19: Explain EAR, WAR, and JAR.


Answer:
EAR represents Enterprise Archive file. It contains the
components of web, EJB, and client. All the components are
packed in a compressed file called .ear file.
WAR represents Web Archive file. It contains all the
components related to the web application. All the components
are packed in a compressed file called .war file.
JAR represents Java Archive file. It contains all the class files
and library files which constitute an API (Application
Programming Interface). All the components are packed in a
compressed file called .jar file.

20: Explain JTA, JNDI, and JMS.


Answer:
JTA represents Java Transaction API. It is used for
coordinating and managing transactions across enterprise
information system.
JNDI represents Java Naming Directory Interface. It is used for
accessing information from directory services.
JMS represents Java Messaging Service. It is used for receiving
and sending messages through messaging systems.

21: Explain EDI.


Answer:
EDI represents Electronic Data Interchange. It is used for
exchanging data through Value Added Network (VAN) which
acts as the transmission medium.
EDI is expensive to install and requires customization by the
exchanging clients. EDI also relies on X12 standards to
interchange documents.

22: Explain EAI.


Answer:
EAI represents Enterprise Application Integration. This makes
one or more applications as single application and requires
data to be transmi ed to the appropriate system at the right
time.
For example, while integrating sales and account systems, it is
necessary for sales to send sales order to accounting to generate
invoice. Also, accounting must send an invoice to sales to
update data for the sales professionals.
This system handles transaction automatically across
application and eliminates human errors.

23: What is the intent for supporting XML in Java?


Answer:
The intent to support XML is to:
a) Ensure Java developers understand XML easier and use
XML and XML developers use Java
b) Provide standard for Java to ensure consistent and
compatible implementations
c) Ensure java platform can be integrated with high
quality

24: What are the protocols used for communicating between


business tier and user interface?
Answer:
The following protocols are used for communicating between
business tier and user interface:
a) HTTP: It denotes
b) JMS: It d
c) RMI: It denote
d) CORBA: ct Request Broker

e) DCOM: ributed Component Object

25: What are the advantages and disadvantages of HTTP


protocol?
Answer:
The following are the advantages of HTTP protocol:
a) Stateless and firewall friendly
b) Easier to load balance and scale HTTP servers
The following are the disadvantages of HTTP protocol:
a) Difficult to maintain user sessions
b) Limited communication with JSP and servlets

26: Explain JRMP.


Answer:
JRMP represents Java Remote Method Protocol. This is used by
Remote Method Invocation (RMI) to pass java objects as
arguments.
Since Java relies on Object Serialization which marshal objects
as stream, RMI relies on the protocol JRMP to transfer objects
from one JVM (Java Virtual Machine) to another.

27: What are the advantages and disadvantages of CORBA?


Answer:
The following are the advantages of CORBA:
a) Supports heterogeneous object
b) Extends the capabilities of ORB (Object Request Broker)
The following are the disadvantages of CORBA:
a) Objects cannot be passed, only arguments can be passed
b) Accepted types of data can only be passed

28: Explain DCOM.


Answer:
DCOM represents Distributed Component Object Model. This
uses ORPC (Object Remote Procedure Call) protocol to support
remote objects.
ORPC is built on top of RPC (Remote Procedure Call) and
interact with runtime services. DCOM supports multiple
interfaces and the components can be created in various
programming languages. Example of languages are: Java, C,
Visual Basic, etc. DCOM is widely used in windows platform.

29: Explain the capabilities of J2EE architecture.


Answer:
The following are the capabilities of J2EE architecture:
a) Performance: performs functionality in a short time
frame
b) Scalability: Supports even if the load on the server
increases
c) Availability: The system is always accessible across
24*7
d) Flexibility: Change in hardware or architecture does
not impact the system
e) Security: The information cannot be hacked and
modified
f) Reusability: The component created for a system can be
reused and save development time

30: Explain System architecture and Reference architecture.


Answer:
System architecture represents the architecture as product. This
comprises the component functions, interfaces of the proposed
system, constraints, and interactions. This is the base for
application design implementation.
Reference architecture represents architecture as method or
style. For a specific domain, reference architecture refers
coherent design principle.
This page is intentionally left blank.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy