Searching for Java Interview Questions and Answers? Start from these basic core java concepts. I have written following articles specifically for helping you in answering some tough java interview questions. I have tried to put more reasoning as much as possible. After going through these interview questions, you will more confidence.
Core Java Interview Questions Series
Divided into 3 parts, these java interview questions will help you in quickly revising most asked core java interview questions in very sort span of time. A best to start with. Part 1, Part 2, Part 3
Object Initialization Best Practices
Object initialization is heavy process and you are expected to know the objects, you create most of day. Java wrapper classes looks very easy from outside, just like primitives, but they are not. Learn how java surprise you with some inbuilt-tricks.
How HashMap Works in Java
HashMap is probably most discussed and controversial topic, if you are appearing in any junior or mid level interview. You can encounter any interview question related to HashMap, if you know how it actually works internally. Let’s end this debate for once and all.
Design a Good Key for HashMap
So you know now that how HashMap works? Now, learn about designing a good key for HashMap. A good way to test if you correctly understood HashMap’s internal working. And be prepare to face this your next interview question as well.
More Questions on HashMap and ConcurrentHashMap
ConcurrentHashMap is advanced version of HashMap and you are expected to know it very well. There are plenty of concepts in this single class alone. This is also another good topic to learn while preparing for your next java interview.
Collection Interview Questions
Should I recommend you to prepare Collection framework and all it’s main classes? I guess you are already intelligent enough. Go ahead and brush up your knowledge.
You are working in java which follows all aspects of a object oriented programming. Your interviewer expect OOPs concepts in java way. Start by learning polymorphism in java.
In previous question, you learned polymorphism. Now it’s time to expand your knowledge by understanding abstraction as well. A very complicated topic for any java interview.
In this post, I have explained encapsulation as well as differentiated it with abstraction. A must read java interview question before moving forward.
Interfaces and Abstract Classes
You can not skip it if you are still learning the basics. Don’t trust you already knew. I will show you the correct scenarios which will help you in cracking some complex interview questions as well as case studies.
Guide for Enum
Enum are here from a long time. They are one of simplest topics if you have read this post. Not encountered in every java interview, but be sure to be ready if you face it.
Implementing Serializable Interface
If you are preparing for java interview with a telecom company or any such domain who use serialization in their application flows, then you will highly benefit from this tutorial. A very good list of do’s and don;ts with serialization in java.
Mini Guide to Main Method
Ever wondered why main() is public, static and void? Let’s clear it for the sake of your knowledge.
Object Cloning Guide
I myself took a long time to understand cloning in java. It really seems simple; use the Cloneable interface and override clone() method. But wait; there is much more to tell and ask in an interview. Read it thoroughly.
When to Use CountDownLatch
Java 5 bought a lot of useful classes in java.uti.concurrent package. CountDownLatch is one of those classes which are highly inquired in any java interview. In this tutorial, CountDownLatch is explained with example and concepts around it.
Why Strings are Immutable?
A very popular java interview question for beginners. I wrote this post separately because the concept is so much important. In fact, immutability is itself a very important concept in java. Feel the tip of iceberg.
How to Make a Class Immutable
Immutability is important in many design aspects and is recommended by all java gurus. Learn to make a java class immutable and be more prepare to encounter a interview question on it.
Now brush up Your Multi-threading Concepts
What is Thread Safety?
Defining thread safety is surprisingly tricky. At the heart of any reasonable definition of thread safety is the concept of correctness. So, before understanding the thread-safety we should understand first, this “correctness”. Learn to describe it when asked in a java interview question.
Thread synchronization, object level locking and class level locking
At the heart of multi-threading and concurrency, there lies the concepts of locking. Locking happens at instance level as well as class level as well. Understand the whole concept in detail in this tutorial.
Difference between “implements Runnable” and “extends Thread”
A very very popular java interview question. Read it quickly if you have any doubt in this simple concept. Better read it to confirm your knowledge.
Compare and Swap [CAS] Algorithm
Concurrency also involves the concept of atomic operations. Read this tutorial to go deeper in understanding this atomic update process taken by java. A good candidate for mid-level java interview question.
Fork/Join Framework Tutorial
This is not new concept but is now used in multiple ways since release of java 8. Learn this sweet and very efficient algorithm to better prepare for your next interview.
How to use BlockingQueue and ThreadPoolExecutor in java
If you want to learn new ways to make concurrent applications, then you simply can’t ignore thread pools and blocking queue concepts. They are the building blocks of most multi-threaded applications in today’s world. You must know these concepts if you really want to learn multi-threading in java and want to feel comfortable before your next interview.
Java executor framework tutorial and best practices
You will learn the executors in previous link, but there are certain things you need to know for using these executors effectively in terms of performance.
Difference between yield() and join()
A very frequently asked interview questions faced by most of the java developers at beginner level.
Difference between sleep() and wait()
Another very frequent question you must remember for interview purpose.
Writing a deadlock and resolving in java
It can come in form of a puzzle. Better be ready for it. A sample program keeping handy will benefit in interview as well as boost your confidence.
I have gone through above java interview questions. Now what?
Above questions are must read before appearing any java interview. Still they do not provide complete coverage. You need to know more and more to perform better in interviews. I will suggest you to read more topics in following sections in given order:
Best Practices Guides
A list of highly recommended best practices. They will open up your mind to think in different directions. In short, they will sharpen you weapon for your next java interview.
Checkout some Puzzles
Solve these puzzles and play around them. You never know what will come in your way on a bad day.
Brush up Design Patterns
Aiming for senior position in your next java interview. You MUST know these design patterns to handle some complex application design issues, which usually are discussed in all interviews now-a-days.
Random browsing on Core Java Topics
Still got strength to read more. Browse more java interview questions here.
Test Your Knowledge
Real java interview questions asked for Oracle Enterprise Manager Project
So far you have been learning all different concepts in java which can come in front of you in form of interview questions. It’s time to see whether you are prepared or not. Go through some real questions asked from Sri, in his interview with Oracle corporation.
Every programming language has its quirks. This book reveals the oddities of the Java programming language through programming puzzles.
Java Concurrency in Practice
Java Concurrency in Practice provides you with the concepts and techniques needed to write safe and scalable Java programs for today’s–and tomorrow’s–systems.
Effective Java by Joshua Bloch
Effective Java, Second Edition, brings together seventy-eight indispensable programmer’s rules of thumb: working, best-practice solutions for the programming challenges you encounter every day.