DevNotes
Support
Real-World Scenarios Β· 8 chapters

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.

CHAPTER 01

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.

11 min Β· 10 Q&A Β· 2 examples
CHAPTER 02

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.

10 min Β· 10 Q&A Β· 9 examples
CHAPTER 03

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.

11 min Β· 10 Q&A Β· 1 examples
CHAPTER 04

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.

11 min Β· 10 Q&A Β· 6 examples
CHAPTER 05

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.

10 min Β· 8 Q&A Β· 7 examples
CHAPTER 06

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.

13 min Β· 10 Q&A Β· 9 examples
CHAPTER 07

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.

10 min Β· 8 Q&A Β· 3 examples
CHAPTER 08

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.

8 min Β· 6 Q&A Β· 3 examples