Java Developer Interview Guide

Java Interview Questions

Screen Java developers with questions on OOP, concurrency, JVM internals, Spring Boot, microservices, and production reliability.

A good Java interview should test JVM understanding, concurrency discipline, framework judgment, and production debugging. Strong candidates explain why a design is safe, observable, and maintainable under load.

Book A Demo
Section 1

OOP

Evaluate whether candidates use abstraction to reduce complexity rather than add ceremony.

1. Design a payment processing abstraction that supports cards, ACH, and refunds. What interfaces would you create?

Interview prompt

Strong signal

Looks for clear boundaries, failure handling, idempotency, and avoiding inheritance-heavy designs.

Follow-up probes

  • How would you add a new provider?
  • Where do retries belong?

Red flags

  • Creates a deep class hierarchy.
  • Ignores transaction and failure states.
Section 2

Concurrency

Test thread safety, locks, executors, futures, and shared-state reasoning.

1. A shared cache occasionally returns stale values under load. How would you reason about thread safety?

Interview prompt

Strong signal

Mentions synchronization, concurrent collections, visibility, immutability, and cache invalidation.

Follow-up probes

  • What does volatile guarantee?
  • When would you use a ReadWriteLock?

Red flags

  • Adds synchronized everywhere.
  • Cannot explain visibility.

2. Compare CompletableFuture with using a fixed thread pool directly.

Interview prompt

Strong signal

Understands composition, exception handling, executor control, and async pipeline readability.

Follow-up probes

  • Where do timeouts go?
  • How do you prevent pool starvation?

Red flags

  • Ignores executor selection.
  • No error propagation strategy.
Section 3

JVM

Measure practical understanding of memory, GC, profiling, and runtime behavior.

1. A Java service has periodic latency spikes. How do you determine whether GC is involved?

Interview prompt

Strong signal

Looks for GC logs, heap metrics, allocation rates, pause times, profiling, and correlation with traffic.

Follow-up probes

  • What metrics would you graph?
  • How would you reduce allocation pressure?

Red flags

  • Tunes heap blindly.
  • Cannot connect GC behavior to latency.
Section 4

Spring Boot

Evaluate dependency injection, transactions, validation, configuration, and service boundaries.

1. A @Transactional method calls another method in the same class and the transaction does not apply. What might be happening?

Interview prompt

Strong signal

Understands proxies, self-invocation, transaction boundaries, and Spring AOP limitations.

Follow-up probes

  • How would you refactor it?
  • How do you test transaction behavior?

Red flags

  • Cannot explain proxies.
  • Treats annotations as magic.
Section 5

Microservices

Test distributed systems judgment, contracts, retries, idempotency, and observability.

1. An order service calls inventory, payment, and notification services. How do you handle partial failure?

Interview prompt

Strong signal

Mentions idempotency, sagas, retries with backoff, outbox pattern, and compensating actions.

Follow-up probes

  • What should be synchronous?
  • How do you trace failures across services?

Red flags

  • Assumes distributed transactions are simple.
  • No observability or retry limits.

Hire better with structured interviews

Access our full question library and automate your evaluation workflow today.