Language Basics

Language Knowledge check

  • What is the difference between method overloading and method overriding in Java, and where would you use each?

  • Explain the difference between final, finally, and finalize in Java?

  • Explain the difference between a shallow copy and a deep copy in Java?

  • Hashcode and equals contract

  • Immutable class design it.

Interface and Abstract class

  • Diamond problem and types of inheritance.

  • Explain what they are and difference between them.

  • Scenario based questions

Lambda

  • What is default method in lambda?

  • How many methods can be abstract methods in lambda?

  • What does "effectively final" mean in lambda expressions.

Java 8 features

  • Explain the use of Optional in Java 8 and how it helps handle NullPointerException.

Collections

  • What is the difference between HashMap and ConcurrentHashMap in Java.

  • How does HashMap work, when we do put and get operation.

  • Does ConcurrentHashMap acquire lock when reading the data?

Streams

  • Explain the difference between terminal and intermediate operations in Java Streams with examples.

  • How does parallel stream work bts?

Concurrency

  • What is a thread, what are its different states?

  • How does wait and notify/notigyAll work?

  • What is race condition?

  • What is volatile?

  • What is happens-before relationship?

  • Difference between synchronized method and block?

  • Can you explain the Re-entrant lock?

  • What is difference between callable and runnable?

  • What is completeable future? How does it work?

  • What is dead lock and livelock?

Framework

  • Explain Executor service?

  • Explain how fork join pool work?

Technique

  • How to stop a thread?

Internals

  • Java Memory Model

  • Java Memory layout

  • Java GC and its types

New Features

Java 9

Java 10

Java 11

Java 12

Java 13

Java 14

Java 15

Java 16

Java 17

Last updated