Sunteți pe pagina 1din 3

Some Java related interview questions, please feel free to update this:

Core Java
1

Java Basics:
a Object class:
1 What is the super class of all java classes
2 What are its methods? And which methods are commonly
overridden.
b What are Immutable objects?
1 How can you make a class immutable?
c Strings
1 Difference when you use == logical operator and use .equal()
method?
2 How does JVM store sting literals?
d Hash maps:
1 What is the return type of key
2 How does hash map bucketing works
3 how does get and put work in case of hash map
4 What methods of Object class are over ridden by hash map.
e Array list:
1 Explain why insertion in an array list is slower.
2 Array list vs link list.
f Static:
1 Can you run piece of code in class without a main() method.
Answer: Yes, by using a static block.

OOA/D Questions: (Define the following concepts)


a What are pillars of OOPS:
b Polymorphism
c Encapsulation
d Inheritance
e Overloading vs. Overriding
f Interface vs. Abstract Class (from design point of view)
1 Can an abstract Class have a constructor
2 Can an abstract class have all implemented functions
g Marker interfaces: Serialization vs. Serializable, Comparator vs.
Comparable
h What is transient variable?

Java Collections:
a Set vs. Map
b Hashmap vs. Hashtable vs. ConcurrentHashMap
c ArrayList vs. LinkedList (Design point of view)

Multithreading
a What are Intrinsic or monitor locks.
b Atomic access

c
d
e
f
g
h
i

What are executors? What is a executor lock.


How does JVM get a lock on an object.
What happens if I directly call the run method in a thread
Thread/Runnable/Executors
Lifecycle of thread
Deadlock - What is deadlock? How to detect? How to prevent?
Synchronization - Why? Uses? Drawbacks?

Advance Java
5

Design patterns
a Read all questions about singleton.

Java Frameworks Related:


a
b
c
d
e
f
g
h
i
j

What is POJO convention? Why POJO based design won over J2EE?
(Java IDEs, Java Reflection, DI etc. are few examples reliant on POJO)
What is Dependency Injection (DI) or Hollywood Principle? Are they
aware of JEE is also reliant on POJO as they dumped J2EE EJB 2.1 specs
in JEE
What is ORM? Uses? Drawbacks? vs. JDBC?
What is MVC means and/or RIA means?
What is SOA (Web Services vs. REST)?
What is ACID means? (in Java Transactions context)
What is Transaction Demarcation means? How do you implement in JEE
and/or Spring framework?
What is Maven? Maven vs. Ant? (are they competitors or can complete
each other)
JMS Queue vs. Topic (Design point of view)
JMS can be considered transactable resource or not (can JMS
participate in transactions: can you update DB and send JMS message
in a single transaction)

How will you proceed if your application, which is in prod for 6 months, is
gradually getting slower?

Database / oracle interview questions:


1
2
3
4
5
6

What are materialized views?


What are clustered indexes?
Is primary key a type of clustered index?
What is a left outer join.
What is a transaction in oracle?
If you write a store procedure, how do you start a transaction (or when a
transaction is started)?
7 HOW DO YOU COMMIT OR ROLLBACK.
8 What is a trigger, can you start your own transaction inside a trigger, how?
9 What is the difference between truncate / delete the whole table.
10 Why do you need to analyze the database / tables.

11 How do you write store procedure that will be part of J2EE global Transaction
(dont rollback or commit yourself in plsql, let the transaction manager
manage it)
12 What is a correlated query?

S-ar putea să vă placă și