Real Interview Questions J2EE

Questions asked during different interviews

Citation
, XML
Authors

Abstract

As a consultant me and my friends have given a good number of interviews and I would like to share with the reader the questions that we were asked. I apologize for the fact that the information is poorly represented as of now. I would try to organize it slowly.

                                      KRG 

difference between a thick client and a thin client?

ejb isolation levels?

ejb attributes?

what is synchronization?

what is volatile variable?

                                Thomson Financial

Difference between aggregation and generalization?

aggregation: manager contains secretary

generalization:

States that the interface of the subclass must include all (public and protected) properties of the superclass

‘inheritance’

association:

The generalization uses inheritance to implement its semantics.
The aggregation uses delegation to reuse the implementation of the component objects.

UML Questions:

Use Case Diagrams: A use case is a set of scenarios that describing an interaction between a user and a system. A use case diagram displays the relationship among actors and use cases.

Class diagrams are widely used to describe the types of objects in a system and their relationships.Classes would be consisting of class-name , attributes(variables) and operations(methods). Association (multiplicity) and Generalization

is found between classes.

Interaction diagrams: They are divided into two types :

Sequence diagram and Collaboration Diagram

what is the difference between ‘containment’ and ‘isa’ relationship?

 What is synchronization?

what is serialization?

what is transient variable?

what is volatile variable?

what type of collections did u use?

what is the difference between hashmap and hashtable?

what is the difference between the a synchronized method and synchronized block?

 how to deploy ear,war files onto WAS?

what are the contents of a ear?

why ejb is used?

what are the components of a ejb?

what interface is available for the client?

why singleton and static are not used in ejb?

 why did u use dao pattern?

what is facade pattern?

 what was the last project u worked on?

what are the challenges that u faced in the last project?

performance:

responsiveness of the system

memory optimization:

Optimizer program

which class objects are there in the memory?

which classes are first?

memory leak:

many objects are generated runtime and are never resused as garbage collection is a low priority process.

memory leak can be solved by keeping class level variables.

if the memory is still hogged then , revise the system application.

what is join?

what is trigger?

different types of loaders in java? bootstrap etc

what is the difference between sax and dom?

why do u get sax exception when u are using dom?

                           SGS Testcom

 

Profile and talk in general about experiences. What parts of the technology are you more interested in the J2EE Application. Front End, Middleware, or backend. Where do you fit in more? Why?

 

Recent experience? What are you doing in the recent experience?

What is final, finally, and finalize in Java?

What are the basic object oriented programming principles?

What is difference between abstract class and an interface? When you would use them?

What is an Enterprise Java Bean?

What are the different types of EJBs?

What is the difference between home and remote interface?

Explain JMS?

What is a Message Driven Bean?

What are the different messaging domains?

What are the different types of JOIN’s that you have. Please explain four of them in detail

What is normalization and denormalization in the database?

What are the different types of collections that you have work with in Java?

Difference between hashmap and hashtable?

Difference between String and String Buffer?

Different states of a thread?

Where do u specify when to load a servlet? web-xml,load-on-startup

Life-cycle of a jsp

Error Handling in jsp

hOW in session handling done in jsp?

explain difference between container managed persistance and bean managed?

explain abt spring framework?

transaction attributes?

what is dirty read?

steps in connecting to the database?

callable statements?

what is a trigger? different types of triggers?

explain certain design patterns?

session facade, value object

explain mvc design pattern?

 

explain factory and singleton?

 

                                      Sony

 

content managed persistance

what are the performance issues and how did u solve the issues?

any web based testing tools?

static synchronize and synchronize

difference between unique key and primary key

what is the difference between callable statements and prepared statements?

how do u dynamically update a database or dynamically access values from a database?

 

                             Starwood Hotels

what was the project u did when u first entered usa?

where it was and who was the end client?

who was the service provider for that project? ibm , hcl

 what was the first project?

 team?

 how many jsp u developed in the last project?

 what is the architecture of struts?

 for a action class , how many form bean?

 can u name the interfaces which the tag class implements?

 what is namespace in xml?

 what is xsd, xsl, xslt?

 if there are two types of errors in jsp , then how do u send the errors to different pages?

 how to refresh a jsp?

 how do u declare a variable global in jsp?

 where have u used a singleton pattern in ur project?

 what happens if use a synchronize method along with the static keyword inside the class?

 what are the design patterns that u used inside the j2ee? Explain them

 if i give u a business delegate, session facade and a dao , how wud u use them?

 why did u write ant scripts if they are already available?

 what do u do when u get a design document?from design document to the design stage

 how do u list a huge list of data , say 10,000 lines on the jsp,part by part?

 what are all the uml diagrams u used? tell me the differences between all?

 did u use clearcase?

 did u use cvs? explain.

 

what is the difference between list,set , map?

difference between hashset and hashmap?

what is overloading?if the return type differs does it overload?

what is type casting ? is it run time?

what is dynamic binding?

what is overriding? is it dynamic?

 

                              Verizon (Florida)

Description: they needed a person for the production support and not a developer

How do u do production support?

what is the difference between struts and velocity?

velocity is used instead of jsp pages , as it is

what are u , a developer and designer?

how to kill

forward and send redirect?

forward all the parameters from one jsp page to another

command on unix to select a particular file

find

pipe and find the statements

 

steps to connect to a database

callable statement

vi,pico

perl -how to open a file

perl how to cut a file into parts based on a keyword

Q)shell scripting :

set

export

 

 

how do u find duplicate rows in the database

how does one jsp tranfer all the variables to another jsp

Q) what are virtual functions in java?

No, Java does not support virtual functions directly as supported by C++. Virtual functions can be implemented in Java using abstract classes and interfaces. Abstract class is a class with declaration of methods, but without their implementation. The implementation of the methods takes place in the subclasses. Another example of virtual functions is interfaces. The only difference between an abstract class and an interface is that abstract classes can be used only when they are superclasses and the subclass implements their methods. Whereas in an interface the methods can be implemented even by classes, which are not inherited.

Q) how do you do thread dump?

During these times, it is helpful to retrieve a thread dump – a log containing information about currently running threads and processes within the Java Virtual Machine. This document describes the steps necessary to retrieve a thread dump.

kill -3 <pid>

pid is the process id.

Q)how do u handle memory leak

 

                          Finance Client

core java:

1) How will u make all the objects serializable by using the toString method?

2) How will u prevent a database beign accessed by every iteration of your for-loop?

3) difference between collections and generics? explain the hierarchy in collection?

collections can store heterogenous objects where as generics is for homogenous objects.

4) why do u use hashmap and why not hashtable? what is the size of hashmap u used and justify using that size?

5) text mining using java?

6) what is object cloning and where have you used it?

7) what is synchronization and what is static synchronize?

8) have u designed any framework ? if so when and where?

9) why do u prefer perl over java in text mining?

10) where have u used serialization in the project? what if u dont want to serialize a certain entry in a collection?

 

dbase:

1) group by , order by , having (give example of u having used it)

 

2) join , full join (give example of u having used it)

3) union vs union all (give example of u having used it)

4) in (give example of u having used it)

5) ROWNUM in Oracle SQL

rownum is a pseudo column. It numbers the records in a result set. The first record that meets the where criteria in a select statement is given rownum=1, and every subsequent record meeting that same criteria increases rownum.

 

http://www.adp-gmbh.ch/ora/sql/rownum.html

6) syntax for creating a role.

7) difference between prepared statement and statement

8) what happens when u execute on a result set?

9) difference between case and decode?

In Oracle/PLSQL, the decode function has the functionality of an IF-THEN-ELSE statement.

The syntax for the decode function is:

decode( expression , search , result [, search , result]… [, default] )

expression is the value to compare.

search is the value that is compared against expression.

result is the value returned, if expression is equal to search.

default is optional. If no matches are found, the decode will return default. If default is omitted, then the decode statement will return null (if no matches are found).

http://www.dba-oracle.com/t_decode_function.htm

 

                                 Cablevision 

what is the difference between ear and war?

 

product related files can be put in ear

 

what are the different types of web services and whcih web service did u use?

 

 document based and rtc

…document based were used:-  web services type depends upon the way the wsdl has beeen written

 

                                  Benz

 

java

interface and why we use it ?
diff static and singleton where you use both  ?
diff hastmap and hashset
string / stringbuffer

servlets

singletrhred / mutlitherd

design patterns

session facade
businnes delegate
service locator

Database

wat DB access you used in ur app
how data is accessed from jsp
database connection pooling
dao pattern

Spring / hibernate  ????

struts

end 2 end flow of struts
wat r actionerrors
wat config files u have in struts
when action class called ?
wat are find forwards ?
wat does action class return ?
wat are main classes in struts
how vaidation is done on form bean level
wat info related 2 struts u type in web.xml

JTA  ????

ejb

wat files for session beans
wat files for entity beans
wat config files u have to set for ejb
how 2 deploy ejb

Websphere / RAD / WSAD

how to deploy ejb in websphere
wat u have done in RAD 
how much expirinece you have in webspehere app server

XML

dtd vs schema ? 
well formed xml ?
xml parsers sax dom ?
how to validate the input xml from a request ?
wat xml tools used ? 
what r components of schema

XSL , XSLT  ????

web services

end 2 end flow of webservices
wat files are reqd for server / client
how do u do xml 2 java mapping 
wat is jaxb ?
wat is soap ?
wat are soap exceptions ?
wat is client proxy/stub ?
how is client proxy call converted into xml ?
wat is service endpoint implementation?
how can ejb session bean used in webservice implementation?

web services security ???? 

               

                          Comcast

difference between interface and abstract class? which one is preffered?

difference between string and string buffer?

polymorphism, overloading,overriding

explain different interfaces in collection?

synchronize vs unsynchronize?

xml namespaces?

dtd vs schema?

why is dao factory used?

explain how a class is injected in spring?

steps taken to achieve ORM in Hibernate?

what is web service?

what is wsdl?

explain where u used?

— stylus studio

— soap ui

— fiddler

why u use maven?

junit

what are the version control u worked on?

what methodology is followed in ur company?

are u comfortable with agile? are u comfortable writing the test ca

a) Application Context vs Bean Factory?

Bean Factory is very basic and application context does more things like Internationalization, Transaction Management 

b) sax vs dom?

sax: read parser

dom: modify some content ,write parser

c) how to implement linked list?

d) use of maven?

e) why did u use ajax?

f) volatile

g) transient?

   why?

h) agile methodology: 

team size,manager

i) how do u debug performance of a query

                              Microsoft

optimize query?

final hasmap add key value pair?

vendor has many advertisment and u need to supply these advertisements to the websites like ebay. design a generic system

ad server

production support

hierarchical represntation of the data

                          Unknown Client

Difference between abstract class and interface? Why is abstract class used?

How do you differentiate between RPC – Encoded and Document Literal through the wsdl?

Interface and Polymorphism?

Front Controller?

Marshalling and Unmarshalling?

                                Vonage

1) What is meta programming in Ruby?

2) What are the components used in Rails?

3) What are the frameworks used in PHP?

4) What are the frameworks used in Perl?

5) Describe the architectural things done in previous projects?

6) Difference between Hibernate 3 and EJB3?

 

                              Web Services Architect

business process modeller

execution model

development model

bpel versioning

security for bpel. who can access the process or what roles

LDAP to authenticate users

what are two types of business process

 

why hibernate ? what advantages ?

what is webservices ?

modes of communication to Web service ?

what is esb ?

1st round of Interview:

1) Explain your current project and one project before that?

  -technologies used

  -development cycle

2) How did you do Production support?

     How do the end users let you know that there is a defect?

         -> escalation  of tickets?

         -> resolution time?

     How do you work on it?

3)  

What is a difference between Stateless and Stateful Session Bean?

What does remove method do in Entity Bean?

Can there be a shared session between JSP and Entity EJB?

what are annotations?

What is the difference between hashmap and hashtable?

What is the difference between SAX and DOM parser?

Why webservices you use?

Did you use RESTful webservices?

Do you do scripting?

3) Did your code ever break?

  Why it never breaks? What do you do to ensure that it does not break?

4) Do you write big queries? How big ? Performance? Do you personally write procedures?

5) Tell me about some challenges that you faced and you overcame in your project

6) Difference between work culture in India and USA?

7) How are you as a Tech Lead? 

  

   -> do you do all work

   

   -> do you assign work

   -> do people under you take responsibility

   -> do you take responsibility      

8) What are the build servers you use? What is Maven? Do you look into the deployment of the services? How do you resolve problems regarding that?

2nd round of Interview:

Why is Hibernate used? How did you use Hibernate in your project?

Difference bewteen Hibernate and Ibatis? In what circumstances would you use one over the other?

Why are web services used? What are the types of webservices? Which one did you use in the project? The advantage of one over the other.

Why Struts is used?Explain the vaidation framework and flow in Struts?

What is the advantage of JSF over Struts?

Why are EJB used? Which ones did you use in the project and how?

Why is Maven used?

What kind of data would be sent as form,application, request and session?

Why is Ruby over Rails used?

How much PL SQL did you personally write in your projects?

Why is Spring used? What is Spring MVC?

What are the kind of tools you used for code coverage?

Explain the projects and the type of Production support you have done?

Is there a B2B application you have worked on?

What is Agile methodology? What did you like in it? When can it not work?

3rd round : F2F

Manager:

Explain about how you can be useful to the project?

Explain about your day to day activities in last project?

Why did you leave your last project?

What was the team size and the how many of them were consultants?

Explanation about some random projects in the resume?

Life cycle of the projects?

Explain the advantage of Ruby on Rails over Perl/PHP?

How much work have you done in writing PL SQL Scripts?

How much comfortable are you in writing shell scripts?

How do you do production support?

Educational details?

Which project did you like the most?

The Manager looks at the smallest project on the resume and questions about the work and the reason for the project being small.

Technical:

Explain the cron jobs?

Can two cron jobs, one running daily and one weekly but executing the same Ruby on Rails application work?

How can you extract distinct names of people when the data is in mixed uppercase and lowercase.

How did you do database reports?

What is ORM?

Can you configure Hibernate in such a way that if the automatic sequence in the table doesn’t work 

only then the automatic sequence generation from Hibernate work?

Exaplin the architecture of some of your projects?

Tech Screen:

Why not Instance variables in Servlet?

http://java.sys-con.com/node/36589