Java Interview Questions

The tech job market is very
active these days, particularly in the developing world. Techies seem to be jumping jobs left, right and center.

Naturally the most discussed topics in developer circles are jobs and job interview questions.

During discussions with a few developer friends, we came up with this idea of creating a databank of frequently asked
interview questions (FAQs).

The
easy way to create this interview questions databank, is to ask as many
people as possible to share the questions they were asked or the
questions that they asked.

If you wish to share Java Interview Question/s, please
add a comment to this particular item.

Please copy paste the following format and add your comment.
We will later compile all data into any easy to use format, mostly an
Excel sheet.

Name (optional):
Company (optional):
Location –
Job Position-
Experience-
Skills –
Questions & Answers:

(Update: Aug 06) – Comments over the past year suggest that in Java questions 1) Interfaces 2) Abstract classes are easily the most popular topics. While for web applications questions related to request, session and application scopes are popular.

For questions on:
Software Quality and Testing Interview Questions
Python Interview Questions

Related:
Java and J2EE Today: An interview with Satish Talim
Interviews with Java experts

Content Team

The IndicThreads Content Team posts news about the latest and greatest in software development as well as content from IndicThreads' conferences and events. Track us social media @IndicThreads. Stay tuned!

95 thoughts on “Java Interview Questions

  • February 1, 2006 at 1:07 am
    Permalink

    Here’s some questions I actually use to screen java applicants. These may seem simple, but you would be surprised how many experienced programmers cannot answer these. The candidate will not get hired if they cannot give a good answer for all of these:

    What is the difference between POST and GET?

    What is Request, Session and Application scope?

    What problems might you encounter if you have a class level variable in a servlet?

    What is an interface?

    What does the ‘protected’ keyword do?

    When writing code to access the database, where is the best place to write your query? In the JSP, the servlet or somewhere else?

    Name some common design patterns.

  • January 24, 2006 at 12:26 am
    Permalink

    i would like to know What is a TX and XA Interface 😕

  • January 20, 2006 at 8:15 am
    Permalink

    A Good Question that i was asked.
    What is a TX and XA Interface

  • December 21, 2005 at 4:17 am
    Permalink

    Checkout Interface vs Abstract Class and other intersteing questions @ [URL=http://agirish.50webs.com]Java, J2ee Interview questions[/URL]

  • December 5, 2005 at 1:46 am
    Permalink

    An interface is a named collection of method definitions (without implementations).

    Interface vs Abstract Class
    An interface cannot implement any methods – abstract class can implement methods.
    A class can implement many interfaces but can have only one superclass.
    Interface can extend other interfaces

  • December 5, 2005 at 1:26 am
    Permalink

    What is an abstract method ?
    Abstract method is a method with no implementation

    What is an abstract class?
    Any class that has an abstract method in it or that does not provide an implementation for any abstract methods declared in its superclasses or implemented interfaces must be declared as an abstract class.
    * An abstract class is not required to have an abstract method in it.

    Q Abstract class vs interfaces
    If an abstract class contains only abstract method declarations, it should be implemented as an interface instead.

  • November 23, 2005 at 3:01 am
    Permalink

    · Interfaces provide a form of multiple inheritance. A class can extend only one other class.
    · Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc.
    · A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class.
    · Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast.

  • October 28, 2005 at 12:04 am
    Permalink

    This is a very good start, it is a good practice if you add the answer to these questions

  • August 28, 2005 at 3:42 am
    Permalink

    🙁 😕 :upset :eek :sigh 😕 :roll :grin :grin :grin :grin :grin

  • August 9, 2005 at 1:16 pm
    Permalink

    Difference between vector and array list?

    If Static method is synchronized which object is considered for lock?

    Explain singleton pattern in java?

    Explain monitors in java?

    How do u connect to database?

  • August 3, 2005 at 8:40 am
    Permalink

    Explain RMI
    Explain Java security
    Types of database drivers

  • July 29, 2005 at 9:28 am
    Permalink

    Location – Mumbai
    Job Position- Software Enginner
    Experience- 2 Yrs
    Skills – Core Java, JSP, Servlets

    Q1. Methods present in Object class?
    Q2. Why do we have wait()/notify()/notifyAll() methods in Objects class?
    Q3. What is MVC Arctitecture?
    Q4. What methods are present in HttpServletRequest/HttpServletResponse/HttpServletSession?
    Q5. Steps invovled in obtaining DBase connection in JDBC?
    Q6. What is Exception Handling and how it is implemented?
    Q7. In how many ways session can be traced?

  • July 29, 2005 at 3:58 am
    Permalink

    Job Position- Programmer
    Experience- 1 year
    Skills – JSP Servlets

    Q. JSP implicit objects?
    Q. Explain MVC with reference to Apache Struts.
    Q. How can you track a customer or store customer data using HttpServlet sessions?
    Q. What does loadonstartup in a web.xml file achieve?

    That’s all I can rememer right now. More later.

  • July 28, 2005 at 6:48 am
    Permalink

    Location – India
    Job Position- Programmer
    Experience- Fresher
    Skills – varied

    Q. What does abstract mean?
    Q. Difference between an abstract class and an interface?
    Q. Difference between overloading a method and overriding a method?

  • July 28, 2005 at 4:29 am
    Permalink

    Name (optional):
    Company (optional): Cognizant
    Location – India
    Job Position- Developer
    Experience- 1 yrs
    Skills – Java J2EE

    Q1: Explain working of a stateless session bean
    Answer- –

    Q2: Explain polymorphism
    Answer- –

    Q3: Explain the J2EE architecture of any project you have worked on
    Answer- –

    Q4: Are java.lang.String instances immutable?
    Answer – Yes.

  • July 26, 2005 at 11:08 am
    Permalink

    Most open source projects are terrible at interoperability. Projects are built for a single need. But because they are open source, you have the ability to change it. Most commerical projects are terrible at interoperability also. With these projects, you can pay the vendor to change it. Companies need to decide which is better for them.

  • May 16, 2005 at 11:45 pm
    Permalink

    A new article on JDJ lists 30 Java interview questions with short answers to each question.

    A couple of example:
    > What’s the difference between an interface and an abstract class?
    > What’s the difference between J2SDK 1.5 and J2SDK 5.0?

    [URL=http://jdj.sys-con.com/read/48839.htm]JDJ Java Interview Questions[/URL]

  • April 19, 2005 at 5:03 pm
    Permalink

    the big problem with Java interviews, is that often the interviewer isn’t competent at the vast variety of complex Java stuff like J2EE, J2ME etc.

    So first guage the competence of the interviewer before you start giving complex answers.

Leave a Reply