Interview Questions when 5 or 6 years of Java/J2EE experience

I have updated my eBook in 2018, which one can download for free from slideshare. Please feel free to share the feedback so that I can update the book and this post.

Generally there were some basic questions:
1. java Objective SCJP level
2. J2EE objective
3. JMS Objective
4. IBM MQ Objective
5. Complicated Multithreading
6. Serialization, File I/O
Below are some extract of questions which I faced while giving Interview of Sapient, Nomura, Gemstone, Mobility, ION, HP, RBS, TIBCO, BOA, CSC. 

Generally I have seen if the interview is for an Investment Bank or any product based organization, then core concepts are very important. And since 2008and just adding this line in 2013 I would say most important concept stills remains Multi threading. And so Executer framework remains hot.

CSC, Chennai
1. 50 numbers ( 1 to 50 ) are distributed in random order in an array of size 50. One number is missing. How to find.
2. Inner Classes, Anonymous Classes.
3. Find manager name who has max. number of employees working under him, when table has employeedID, Name, and ManagerID as columns. and Manager can also be employee.
4. Serialization.
5. How to design a web application, medium size.
6. Write logic to print alternate elements in a ArrayList, even some are removed.
7. How to implement a Hospital scenario, where doctor is examining patients, and emergency cases, and informing doctor of emergency cases, scheduling, etc.
 8. How to select unique elements from a table.
9. Calculate number of legs, and give formula:
7 persons, each person having 7 bags, each bag having 7 dogs, and each dog having 7 puppies.
Bank Of America, Mumbai
1. How is semaphore implemented.
2. How to ensure only one instance in Singleton class.
3. How synchronization works, inside JVM.
4. Master JVM is holding objects. Slave JVM's are reading and writing the object.
What problems can come and what is solution.
5. How Garbage Collection works in JVM.
6. When are class garbage collected, when are classes unloaded.
7. How to ensure that instance is never garbage collected.
8. Different protocols for Web Services.
9. Managing Session in Web Services
10. RMI, how EJB works
11. passing objects between two JVM's.
12. role of WSDL, stubs, etc. in Web Services.
13. Garbage Collection Tuning parameters.
14. LAZY Loading in ORM.
15. Why there is Stack and heap in JVM. Why this structure.
16. how much memory a program consumes, when no objects created inside program.
1. JCA - Tntro
2. JPA - Intro
3. EAGER/ LAZY loading
4. JPA relations
5. IBM MQ Objective
6. JMS session, Thread Safety In JMS
7. JMS providers
8. JMS implementation
9. AQ Provider and implementation using JNDI
10. Garbage Collection algorithms.
11. SOAP
12. JTA.
RBS, Gurgaon
1. Hashing Algorithm.
2. Search Algorithm
3. MVC design Pattern.
4. Multi threading Objectives.
5. Design Application which handles a particular operation for millions of trades, operation like trade validation. Application communicates external application for data.
6. Several Designing Questions.
7. Scala, Open Source high performing JMS implementations, Dynamic languages
8. Cache Implementation.
9. How Oracle Coherence works.
Gemstone, Pune
1. Why Use EJB 3.0
2. Why use JPA
3. Why use JPA with ORM, Standard ORM products
4. Writing Complex Query while using JPA and ORM
5. JTA, how it works
6. JTA, how to use
7. Where to use JDBC and where ORM
8. JSF Architecture, who is model, view and controller
9. Optimistic Lock in JPA - Detailed
10. Multithreaded program to read large file/ code and design
HP Labs, Banglore
1. Latch, Barrier, synchronized, Lock, ThreadPoolExecuter, Garbage Collection Algo.
2. Which forums do you follow,  Cloud Computing, How to improve programming and Coding skills.
3.  Design horse racing application.
4. Struts, how to extend struts. Why to use Struts.
5.  Where to use messaging
1. Core Java SCJP level
2. Current Project Architecture
3. Message Flow in current project.
4. Fault Tolerance in JMS
5. Hashing Algo in Java, HashMap
6. Aggregation, Composition, Encapsulation, Abstraction.
7. How to implement Thread Pool
8. Complete Garbage Colection Algo.
9. DataSource, DB connection pool - how it works.
10. Exception- Logic, how to handle and design Exception, Error.
11. NIO-concept, Socket handling using NIO.
12. Adapter Design pattern
13. Stored Proc, Trigger
14. JDK1.5 Thread pool
15. Serialization, Externalization
16. Immutable, FInal, Usage of Final and Immutable
17. Exception handling in the spawned threads
18. RESTful Web Services, JEEVAN
19. Types of Parsers
1. deep copy and shallow copy
2. hash code
3. graceful shutdown of threads
4. NaN, 0/0
5. wrapper classes.
6. BootStrap Class Loader
7. Oracle OCI.
8. Oracle JDBC drivers
9. Oracle Thin and Thick Clients.
10. Oracle Rak
11. MQ API, MQ classes for Java.
12. MessageId, Priority for MQ message.
13. Garbage Collection
14. Java Green Threads
15. Coorelated Sub Queries.
16. Steps to make connection to MQ using Java.
17. Options to set for browsing message in MQ Queue.
18. Client Mode/Bindings Mode.
19. Log4j
1. How would you implement your own Thread Pool.
2. What is NIO
3. Best way to read data from socket using traditional I/O
4. Beat way to read file.
5. How to read characters from InputStream.
6. How Serialization works
7. Synchronization
8. how to implement counter in servlet.
9. how hashtable is thread safe.
10. CharSet, Enocder, Decoder
11. AtomicInteger, volatile, transient.
12. JTA, XA, how XA works, two phase commit.
13. Role of transaction manager in XA transaction.
14. XADataSource, and closing XADataSource.
15. UserTransaction
16. JCA Architecture
1. How would you implement cache in java.
2. How would you implement auto complete using java, jsp.
3. How would you implement a chache with auto complete feature.
4. How to make class immutable.
5. How to serialize immutable class.
6. How to gaurantee message delivery in JMS, fault tolerance
7. Message recovery techniques and redelivery.
8. DROP table.
9. Oracle Stored Procedure or function
10. Struts architecture
11. JSP Exception Handling
12. java Objective SCJP Level
13. java Design Pattern
14. J2EE objective
15. Implementing references
16. UNIX Commands - grep, softlink, hardlink
17. Serializable, Externalizable, Cloneable
JDk 1.5 Collections classes.
Multintreading Concepts - Barrier, Latch, etc.
JMS functioning
SQl Query using JOINS
Java Design pattern - detail
Overloading, Overriding, Comparator, Comparable, hashCode(), equals(), Serializable, Externalizable, RMI, garbage Collection.
Please read my more posts in the same category - Answers Java/J2EE interview questions


  1. Can you please post code for "Multithreaded program to read large file/ code and design"

  2. Quite helpful but would also want to include some real world applications which is asked in the interviews .... just to test the design capabilities of candidate.

  3. Some of the design questions I faced were:

    Design a Horse Racing System, and a Horse trading System. from end to end, which means you decide which technologies to use. it would be desktop or web. Which framework to use, and then the class diagram also.

    Design the flow of communication within Trading System, between front office and back office. There might be issues like
    u receive trade confirmation, and trade cancellation for same trade with few seconds, when already the trade confirmation is under processing.
    Design message flow, and prevent message loss.

    Design a small application which is used by doctor to handle patients. When there is one doctor, one assistant and few patients. Means it was related to scheduling.

    There is a System A, which has all the counterparty info, person who is doing trade.
    You have to design an application which receives trades, validates, sends confirmation to front office, and updates the Counterparty info in System A, i.e. updation of new trades. Remember trade volume is millions per day or may be more.
    You can think of better Cache, messaging system, and might think of protocol.

    Design your own Cache, is a very common question.

  4. These questions or atleast preparation based on these questions are very helpful for one to succeed in interviews. Thanks a lot.

  5. Hi

    Tks very much for post:

    I like it and hope that you continue posting.

    Let me show other source that may be good for community.

    Source: Doctor interview questions

    Best rgs

  6. I feel really good to see such useful information.

  7. Urgent Opening [java/j2ee] Bangalore Location

    we are also continuously HIRING and seek your referrals for:
    1) JAVA, J2EE (3-5 years)

    5. UI Developer
    Strong in Photoshop, HTML, CSS and JavaScript.
    Very good in Flash, XML and XHTML
    Very good logical & analytical thinking.
    Very good communication/client communication
    Good to have: ASP.Net, JavaScript libraries and UI standards.
    2) Embedded linux (3-5 years)
    3) Linux, Kernel development (3 to 5 yrs)
    Please send in your updated Resume to

  8. its a very gud knowledge u imparted...i m having 3.8 years experience n now a days going across the interviews so would like to share spme common questions.


    questions are genraly the oops concept with proper real examples, not the bookish knowledge.
    XML parsing
    servlets working
    equals and hashcode
    transient and volatile
    jsp tag libraries

    bebo technologies

    how to make callender in struts,
    what if i have an write access in method but and readonly field...will that method be able to change the field?

    how timezones are handled

    how we integrate hibernate in struts

    why we use hql not sql

    how we make custom tags?

    how validations are done on client side only not on server side in struts

    3. Meritech

    Connection pooling,

    how to make our own exception class

    joins in sql

    if control is gng from one servlet to sec and then to third, will second servlet be able to return the values

    how to set max connection

    forcefull GC

    4. Relay

    abstract classes and interfaces

    equals , == and hashcode()

    many to many mappings in hibernate

    overloading and overriding

  9. thanks.. this is very helpful

  10. Very useful info. Thanks a ton!

  11. Is there some links where we can find the solutions as well or from where you copied the question.


  12. nice post.. very helpful.. With answers will be very much appreciated. :-)

  13. Very good info.Keep posting :-)

  14. Nice... great collection.... Thank you....

  15. Hi

    Tks very much for post:

    I like it and hope that you continue posting.

    Let me show other source that may be good for community.

    Source: SunTrust Banks interview questions

    Best rgs

  16. it is very help full .very rare questions


Post a Comment


Popular Posts