Skip to main content
Journey Uncommon Logo
JourneyUncommon

Java Interview Questions (541 to practise)

Java runs a very large share of enterprise back ends. Its interviews reward knowing the memory model as well as the syntax.

Collections behaviour, equals and hashCode contracts, string interning, checked versus unchecked exceptions, stream laziness, and the concurrency primitives.

Total questions
541
Easy
112
Medium
211
Hard
218

Where it shows up: Banking, large-scale services, Android, and any company running Spring in production.

Sample Java questions

Twenty real Java questions from the library, code snippet included. Nothing here is paraphrased for search engines. It is the same text a signed-in user sees.

Sign in to answer

Everything above is free to read. Answering needs a free account.

We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the answer options and the worked explanation for every Java question stay behind a free account. Signing in is free and takes a few seconds.

Java topics covered

44 distinct Java topics are tagged across the library. These are the real topic labels stored on the questions, not a hand-written list.

  • stream pipelines (36)
  • primitives and char width (25)
  • if switch loops (23)
  • try-with-resources (23)
  • main entry point (22)
  • final and constants (22)
  • class loading delegation (20)
  • String.intern and pool (19)
  • sealed types usage (17)
  • ExecutorService usage (16)
  • functional interfaces (16)
  • CompletableFuture composition (15)
  • pattern matching switch instanceof (15)
  • bytecode and operand stack (14)
  • HashMap internals treeify (13)
  • records and compact constructors (12)
  • AQS internals (12)
  • ConcurrentHashMap (12)
  • ZGC vs G1 (12)
  • Collectors toMap groupingBy (12)
  • Optional patterns (11)
  • Comparator comparing thenComparing (11)
  • synchronized monitors biased locks (11)
  • virtual threads carrier pinning (10)
  • final-field publication (10)
  • volatile semantics (9)
  • Lambdas and method refs (9)
  • reflection cost (9)
  • ThreadLocal lifecycle leaks (9)
  • JIT HotSpot tiered (9)
  • Integer caching identity (8)
  • == vs equals (8)
  • BigDecimal (8)
  • annotations and retention (8)
  • JMM happens-before (8)
  • escape analysis scalar replacement (8)
  • object headers compressed oops (7)
  • G1GC regions (7)
  • Duration vs Period (6)
  • generics bounds wildcards PECS (5)
  • generics (4)
  • EnumSet EnumMap (4)
  • Generics (bounds/wildcards/PECS) (2)
  • send and public_send (1)

Search and filter every Java question

Difficulty