Java Backend Production Scenarios
72 scenario-based interview questions with full answers: slow APIs and production incidents, connection pools and transactions, sagas and resilience, Kafka lag, duplicates and DLQs, idempotency and locking, OutOfMemoryError, GC, thread pools and deadlocks, Spring Boot pitfalls, JWT and authorization, replay protection and secrets management.
Production Issues & API Performance
Scenario questions 1β10: slow APIs with idle CPUs, local vs production gaps, traffic spikes, designing for 10,000+ requests per second, scaling that doesn't help, slow downstream services, timeouts, sudden HTTP 500s and intermittent failures.
Database & Transaction Scenarios
Scenario questions 11β20: connection pool exhaustion, queries that slow down at millions of rows or only in production, losing the database at peak, concurrent updates, rollbacks, @Transactional that doesn't roll back, self-invocation, offset vs keyset pagination, and retries after a lost response.
Microservices & Distributed Systems Scenarios
Scenario questions 21β30: failed payments after order creation, lost payment confirmations, cascading failures, Resilience4j circuit breakers, retries without retry storms, consistency across services, Saga vs distributed transactions, distributed monoliths, gateway debugging and distributed tracing.
Kafka & Event-Driven Scenarios
Scenario questions 31β40: growing consumer lag, duplicate processing, poison messages, retry topics and DLQs, high-throughput consumers, crashes before offset commits, the outbox pattern, ordering across partitions, slow consumers and absorbing event spikes.
Idempotency, Concurrency & Duplicates
Scenario questions 41β48: duplicate order clicks, retried payments that already succeeded, concurrent balance updates, scheduled jobs on several instances, storing idempotency keys and handling concurrent duplicates, lost responses, optimistic vs pessimistic locking, and safety across instances.
Java, JVM & Multithreading Scenarios
Scenario questions 49β58: OutOfMemoryError in production, long GC pauses, exhausted thread pools, slow CompletableFuture pipelines, too many threads, deadlocks, ConcurrentHashMap race conditions, memory leaks in a garbage-collected language, virtual threads, and async tasks that fail silently.
Spring Boot Application Scenarios
Scenario questions 59β66: debugging an API with unexpected results, injected beans that are null, transactions that commit despite exceptions, state problems across multiple instances, tracing configuration sources, centralised exception handling, backward-compatible API changes and slow startup.
Security & Authentication Scenarios
Scenario questions 67β72: a valid JWT that still gets 401 or 403, renewing expired tokens securely, role-based access control with many roles, preventing access to other customers' orders, protecting payment APIs from replays, and managing secrets across environments.