Popular Posts

Friday, March 09, 2012

Core/advance Java Interview Questions

Here are some latest / advanced/difficult Java J2ee technical interview questions for Senior developer / architect / Lead level:
1) What are OOPs concepts in Java? Define Abstraction, Polymorphism, Inheritance, Encapsulation with examples.
2) What are different types of Inheritance in java?
3) What are different types of Polymorphism OR difference between Compile time & Run time polymorphism?
4) Give an example in your project (OR in general) of Polymorphism.
5) When we will use Abstract class & Interface?
6) Difference between Composition & Aggregation?

7) What is serialization?
8) What is synchronization?
9) Difference between Overloading & overriding.
10) What is Immutability? Why this is required? Why are string immutable?
11) How does class loading works in java? When we will write our own class loader?
12) What are important methods in Object class (equals, hashcode etc.), when we shall override them & how?

13) How does hashing / hash code works in java?
14) What are basic collection types in Java? Which one are sorted & which are ordered? What is difference between sorting & ordering?
15) Difference between Comparator & Comparable?
16) Difference between Enumeration & Iterator?
17) Difference between Iterable & Iterator?
18) Difference between Enum & Enumeration?

19) Why garbage collection in java is not on demand?
20) What is java - pass by value or pass by reference? Difference between them ?

21) What is diff bet'n wait n sleep methods?
22) What are various methods in Object class?
23) What is diff bet'n Array & Arraylist?

24) Explain the Java Class loader mechanism. How would you prevent someone from overriding the java.lang.Object class?
25) Can interfaces contain inner classes?
26) What happens when you try to serialize a class whose base class does not implement serializable?
27) What happens if you try to pass an int variable to a function that accepts only:
          a) long b) Double() c) Number() ?
28) How can you prevent flow of control to a finally { } clause?
29) I write two classes : I write a static method in the base class and override that static method in the child
           class. Will this code compile?
30) What happens if you try to start a thread that's already been started?

Answers to follow in some time.