Every Java interview question on this site

1100 questions, gathered from all five places they live — the reference curriculum, the release catalogue, the company-type breakdowns, and the follow-ups and self-checks inside every written entry. A green dot means the answer is written.

Questions
1100
Answered
286
Sources
5
Duplicates folded
133

This list is derived, never authored. Every question here is read from the file that owns it, so adding one anywhere puts it on this page at the next build and there is no second copy to fall out of date. The same question asked in two places is folded into one — 133 of them were.

1100 questions

Build and delivery · CI and delivery

Build and delivery · Dependency management

Build and delivery · Maven and Gradle

Build and delivery · Packaging and containers

Core Java · Collections

Core Java · Concurrency

Core Java · Dates and time

Core Java · Exceptions

Core Java · Functional Java

Core Java · Generics

Core Java · I/O and files

Core Java · JVM and memory

Core Java · Language basics

Core Java · Modern Java

Core Java · Objects and OOP

Core Java · Strings

Data structures and algorithms · Arrays and strings

Data structures and algorithms · Complexity analysis

Data structures and algorithms · Hashing

Data structures and algorithms · Lists, stacks and queues

Data structures and algorithms · Recursion, DP and greedy

Data structures and algorithms · Searching and sorting

Data structures and algorithms · Trees and graphs

Databases and persistence · Indexing

Databases and persistence · JPA and Hibernate

Databases and persistence · NoSQL and caching

Databases and persistence · Performance and operations

Databases and persistence · Schema design

Databases and persistence · SQL fundamentals

Databases and persistence · Transactions and isolation

Design patterns · Behavioural patterns

Design patterns · Creational patterns

Design patterns · SOLID and design judgement

Design patterns · Structural patterns

Microservices and APIs · Data across services

Microservices and APIs · Messaging and events

Microservices and APIs · Observability

Microservices and APIs · Resilience patterns

Microservices and APIs · REST and API design

Microservices and APIs · Service communication

Security · Authentication

Security · Authorisation

Security · Common web vulnerabilities

Security · Crypto, secrets and dependencies

Spring and Spring Boot · Spring AOP

Spring and Spring Boot · Spring Boot

Spring and Spring Boot · Spring core and dependency injection

Spring and Spring Boot · Spring Data and transactions

Spring and Spring Boot · Spring MVC and REST

Spring and Spring Boot · Spring Security

Spring and Spring Boot · Testing Spring applications

System design · Caching

System design · Case studies

System design · Data storage at scale

System design · Fundamentals

System design · Reliability and operations

System design · Traffic, limits and delivery

Testing · Integration testing

Testing · Mocks and test doubles

Testing · Unit testing with JUnit

Testing · What to test, and how much

Collections · How does HashMap work internally?

Collections · When would you use LinkedList instead of ArrayList?

Concurrency · How does ConcurrentHashMap achieve thread safety?

Concurrency · What does volatile guarantee, and what does it not?

Concurrency · What is the happens-before relationship?

Exceptions · What is the difference between checked and unchecked exceptions?

Java8 · How do Collectors.groupingBy and toMap differ in failure modes?

Java8 · When is parallelStream() a mistake?

Java8 · Why does a stream with no terminal operation do nothing?

Oop · Is Java pass-by-value or pass-by-reference?

Oop · What is the contract between hashCode() and equals()?

Spring aop · How does Spring AOP work, and what are its limits?

Spring core · Why is constructor injection preferred over field injection?

Spring data · How does @Transactional actually work, and when does it silently do nothing?

Strings · What is the difference between String, StringBuilder and StringBuffer?

Strings · Why is String immutable, and what is the string pool?

Practice round · Full round replay — @Transactional

Practice round · Full round replay — ArrayList vs LinkedList

Practice round · Full round replay — checked vs unchecked

Practice round · Full round replay — collectors

Practice round · Full round replay — ConcurrentHashMap

Practice round · Full round replay — dependency injection

Practice round · Full round replay — hashCode/equals

Practice round · Full round replay — HashMap

Practice round · Full round replay — parallel streams

Practice round · Full round replay — pass-by-value

Practice round · Full round replay — Spring AOP

Practice round · Full round replay — stream laziness

Practice round · Full round replay — String immutability and the pool

Practice round · Full round replay — String vs StringBuilder

Practice round · Full round replay — the memory model

Practice round · Full round replay — volatile and synchronized

GCC / captive centres · 1-2 years

GCC / captive centres · 3-4 years

GCC / captive centres · 5-6 years

Product-based · 1-2 years

Product-based · 3-4 years

Product-based · 5-6 years

Service-based · 1-2 years

Service-based · 3-4 years

Service-based · 5-6 years

Java 10 · Local-variable type inference (var)

Java 11 · HTTP Client (standard)

Java 11 · Launch single-file source-code programs

Java 11 · Remove the Java EE and CORBA modules

Java 11 · String convenience methods

Java 12 · Switch expressions (preview)

Java 13 · Text blocks (preview)

Java 15 · Helpful NullPointerExceptions

Java 15 · Text blocks

Java 16 · Pattern matching for instanceof

Java 16 · Records

Java 17 · Deprecate the Security Manager for removal

Java 17 · Sealed classes

Java 17 · Strongly encapsulate JDK internals

Java 21 · Generational ZGC

Java 21 · Pattern matching for switch

Java 21 · Record patterns

Java 21 · Sequenced collections

Java 21 · String templates

Java 21 · Virtual threads

Java 22 · Foreign Function and Memory API

Java 22 · Launch multi-file source-code programs

Java 22 · Unnamed variables and patterns

Java 23 · Markdown documentation comments

Java 24 · Permanently disable the Security Manager

Java 24 · Stream gatherers

Java 24 · Synchronize virtual threads without pinning

Java 25 · Compact object headers

Java 25 · Compact source files and instance main methods

Java 25 · Flexible constructor bodies

Java 25 · Module import declarations

Java 25 · Scoped values

Java 25 · Structured concurrency

Java 5 · Autoboxing and unboxing

Java 5 · Enums

Java 5 · Generics

Java 5 · Varargs and the enhanced for loop

Java 6 · Library, JVM and tooling only

Java 7 · Multi-catch and precise rethrow

Java 7 · NIO.2 — java.nio.file

Java 7 · String pool moved to the heap

Java 7 · switch on String

Java 7 · The diamond operator

Java 7 · try-with-resources

Java 7 · Underscores and binary literals

Java 8 · Default methods

Java 8 · Lambda expressions

Java 8 · Optional

Java 8 · Remove PermGen (Metaspace)

Java 8 · The java.time API

Java 8 · The Stream API

Java 9 · Compact strings

Java 9 · Immutable collection factories

Java 9 · Indified string concatenation

Java 9 · The Java Platform Module System