Interview Questions

Basic Core Java

Why should I choose Java for Software Development? What are Pros and Cons of Java?
Can we cast an int value into byte type variable? what if the value of int is larger than byte?
Can We store a double value in a long type variable without casting?
How many ways we can create an object in Java?
Why Java is not 100% Object-oriented language?
What are the differences between 32-bit and 64-bit versions of Java?
Can we call static method with null object?
Can we override static method in Java?
What will be the output of following java program?
What is the difference Between java.util.Date and java.sql.Date in Java ?
What is difference between using Serializable & Externalizable Interfaces in Java?
Which Java data type would you choose for storing sensitive information, like passwords, and Why?

Collection Framework

Difference between List and Set in Java Collection ?
When should we choose LinkedList over ArrayList for a given Scenario and Why?
Is there concurrent version for TreeMap and TreeSet in Java Collections Framework?
What is difference between Collections. Sort() and Arrays.sort()? Which one is better with respect to time efficiency?
What are fail-fast and fail-safe Iterator?
What is difference between Iterator and LisIterator?
Why Prime Numbers are considered in writing certain algorithms like hashcode()?
What all collections utilizes hashCode() method in java?
Describe CopyOnWriteArrayList? Where is it used in Java Applications?


What are common multi-threading issues faced by Java Developers?
What are different states of a Thread? What does those states tell us?
What happens when wait() & notify() methods are called?
What is difference between sleep(), yield() and wait() method?
What is difference between Callable and Runnable Interface?
What is difference between intrinsic synchronization and explicit locking using Lock?
What will happen when an exception arises from within a synchronized code block? Will lock be retained or released?
What is difference between Executor submit() and execute() method?

String & Immutability

How can we maintain Immutability of a class with a mutable reference ?

Java Date/Time

What are the standard ways for handling TimeZone in database transactions?
How to convert time from One Time Zone to another in Java?
What will be the output of this date/time program?
What is the difference Between java.util.Date and java.sql.Date in Java ?

Atomic Concurrency

When we choose LongAdder and LongAccumulator over AtomicLong & AtomicInteger ?

Software design 

What are the important paradigms for Developing the Clean Object-Oriented Code?
What are the key difference between unit, integration and functional testing?

Java 8 Features

What are new Features added in Java 8?

Other Programs

How to design Money Class in Java ?