Blog Archives

00: Top 50+ Core Java interview questions & answers for 1 to 3 years experience

Top 50 core Java interview questions covering Java core concepts with diagrams, code, examples, and scenarios. If you don’t get these Java interview questions right, you will not be getting an offer.

== Vs equals(…)

Q1. What is the difference between “==” and “equals(…)” in comparing Java String objects?
A1. When you use “==” (i.e. shallow comparison), you are actually comparing the two object references to see if they point to the same object. When you use “equals(…)”, which is a “deep comparison” that compares the actual string values. For example:

Tags:

00: Top 50+ Core Java interview questions answered – Q11 to Q23

The focus is on Java OOP interview questions and answers. Q11. What is the difference between constructors and other regular methods? A11. Constructors must have the same name as the class name and cannot return a value. The constructors are called only once per creation of an object while regular…

Tags: , , ,

00: Top 50+ Core Java interview questions answered – Q24 to Q36

Focus is on Java classes, interfaces and generics the interview questions and answers style. Java classes and interfaces are the building blocks. Q24. What happens when a parent and a child class have the same variable name? A24. When both a parent class and its subclass have a field with…

Tags: , , , ,

00: Top 50+ Core Java interview questions answered – Q37 to Q42

As a Java developer, you may not need to know how the JVM works, but the most important topic that you must know is Java Garbage Collection. How the Garbage Collection and object referencing work in Java. Q37. What do you know about the Java garbage collector? When does the…

Tags: , , , ,

00: Top 50+ Core Java Interview questions answered – Q43 to Q54

Q43. What can you tell about the performance of a HashMap compared to a TreeMap? Which one would you prefer? A43. A balanced tree does have O (log n) performance. The TreeMap class in Java maintains key/value objects in a sorted order by using a red-black tree. A red-black tree…

Tags: , , , ,

01: 15+ Java multithreading interview questions & answers

Multithreading is one of the important features of Java, and multithreading interview Q&As can reveal a lot about your depth of core Java knowledge. Most importantly, it is not easy to grasp multithreading concepts without lots of hands-on experience. Let’s start with the beginner basics & then get into Java concurrency management interview Q&As for the experienced.

What is a thread?

Q1. What is a thread?
A1. It is a thread of execution in a program. The JVM (i.e. process) allows an application to have multiple threads of execution running concurrently. In the Hotspot JVM there is a direct …

Tags:

02: 10 Java String class interview Q&As

Java Collection interview questions and answers and Java String class interview questions and answers are must know for any Java developer as these two APIs are the most frequently used in your Java application code. You can’t write any decent Java application without these 2 APIs.

Q1. What will be the output of the following code snippet?

Tags:

02: 5 Java multithreading scenarios interview Questions & Answers

Java interview questions & answers on multithreading scenarios to judge your experience in building applications with concurrency in mind. Q1. Can you give some scenarios where you built concurrent systems? A1. In a concurrent system different threads run concurrently, whereas in a distributed system different processes often in separate machines…



03: 7 Things you must know about Java locks and synchronized key word

7 Things you must know about Java locks and synchronized key word summarizes the key basics. #1. Each Java class and object (i.e. instance of a class) has an intrinsic lock or monitor. Don’t confuse this with explicit lock utility class that were added in Java 1.5, and I will…



03: Understanding Big O notations with Java

Q1.  Have  you seen job advertisements requiring Java candidates to work in real-time or high volume transaction processing systems? A1.  If you are applying for such jobs, you can be quizzed on Big O notation. Here are some basics to brush up on. Big O gives you the upper bound. For example,…



17 Java Collection interview questions & answers

Java Collections interview questions and answers and Java String class interview Q&As are must know as you can’t write any decent Java application without these 2 APIs. This post focuses on Java Collection interview Q&As on differences between X and Y based on the Java Collection Framework (i.e. JCF). Q1….



7 Java Modifiers every interviewer likes to quiz you on

Java modifiers like final, finally, const, volatile, and transient are very popular with the job interviewers. You will see why because of the possible drill down questions.

Q1. What is the difference between ‘final‘ and ‘const‘ modifiers on a variable?
A1. This is a bit of a tricky question because the ‘const‘ is a reserved keyword in Java, but not used. In C++ it means a variable is a constant(i.e. its values cannot be changed).

1. final

The final keyword in Java can be used in many contexts – variable, method, and …



9 Java Garbage Collection interview questions & answers

Java Garbage Collection interview questions & answers to ascertain your depth of Java knowledge in building industry strength Java applications. Determining optimal Garbage Collection (GC) settings is critical to achieve high throughput & low latency. Q1. In which part of memory does Java Garbage Collection (i.e. GC) occur? When does…



Java Generics in no time “? extends” & “? super” explained with a diagram

Generics in Java can be be a bit tricky to get your head around. Hope the explanation below enhances your understanding of generics. This complements 5 Java generics interview Q&As with examples. Raw List, List <Object>, and List<?> A raw List: is a heterogeneous mixture or a mixed bag that…



Q1 – Q10 Java OOPs interview Q&As

If you don’t get Java OOPs interview questions & answers right in the job interviews you can say OOPS !!!! to your Java interview success. Q1. Is Java a 100% Object Oriented (OO) language? if yes why? and if no, why not? A1. I would say Java is not 100%…

Tags:

300+ Java & Big Data FAQs - Quick Prep

Java & Big Data Tutorials

Top