Java Backend Interview Handbook (150+ Unique
Questions)
Total Unique Questions: 234
Core Java
1. ExecutorService and its types
2. Internal working of HashMap
3. HashMap threshold
4. Default capacity of ArrayList
5. Default capacity of Vector
6. this vs super
7. Garbage Collection
8. Types of Garbage Collectors
9. Stack vs Heap memory
10. ConcurrentHashMap null key behavior
11. Private constructor use cases
12. Sealed Classes (Java 17)
13. HashMap collision handling
14. Fail Fast vs Fail Safe iterator
15. Memory leak in Java
16. Why String is immutable
17. String Pool internals
18. equals vs hashCode
19. Mutable keys in HashMap
20. Java 17 features
21. var keyword
22. effectively final variable
23. Record class
24. Optional class
25. Checked vs unchecked exceptions
26. Comparable vs Comparator
27. SOLID principles
28. Liskov Substitution Principle
29. Factory Pattern
30. JVM memory management
Multithreading
1. Runnable vs Callable
2. CompletableFuture vs ExecutorService
3. Synchronization method vs block
4. volatile keyword
5. volatile vs Atomic classes
6. synchronized vs ReentrantLock
7. Thread lifecycle
8. Context switching
9. Daemon thread
10. Thread priority
11. Thread Scheduler
12. Deadlock
13. Livelock
14. Starvation
15. Race Condition
16. Java Memory Model
17. Happens-before relationship
18. Atomicity
19. Visibility issue
20. CAS
21. AtomicInteger vs synchronized counter
22. wait notify notifyAll
23. sleep vs wait
24. Producer Consumer
25. BlockingQueue solution
26. CountDownLatch
27. CyclicBarrier
28. Future and Callable
29. CompletableFuture methods
30. Thread pool sizing
Spring Boot
1. JPA vs Hibernate
2. Why JPA over Hibernate
3. Pagination and Sorting
4. Bean Lifecycle
5. Spring Container internal working
6. @EnableAutoConfiguration
7. @Primary vs @Qualifier
8. IOC vs Dependency Injection
9. Spring Profiles
10. @Transactional internals
11. Lazy vs Eager Loading
12. @Component vs @Service vs @Repository
13. @Controller vs @RestController
14. Spring Boot startup lifecycle
15. Auto Configuration internals
16. Filters vs Interceptors
17. BeanFactory vs ApplicationContext
18. CrudRepository vs JpaRepository
19. N+1 Query Problem
20. SpringFactoriesLoader
21. Embedded Tomcat configuration
22. DataSource auto configuration
23. CommandLineRunner use cases
24. [Link] vs properties
25. Actuator internals
Spring Security
1. JWT Authentication
2. JWT generation flow
3. Authentication vs Authorization
4. CORS
5. CSRF
6. @CrossOrigin
7. SecurityContextHolder
8. Session fixation
9. Remember-me authentication
10. Security filter chain
11. OncePerRequestFilter vs GenericFilterBean
12. JWT vs Session Authentication
13. Logout implementation
14. Testing secured APIs
15. @WithMockUser
16. Spring Security in Microservices
Microservices & System Design
1. Inter-service communication
2. Feign vs RestTemplate vs WebClient
3. Saga Pattern
4. Choreography vs Orchestration
5. API Gateway
6. Service Discovery
7. Eureka Server
8. Eureka heartbeat
9. Config Server
10. Circuit Breaker
11. Resilience4j
12. Distributed Transactions
13. Handling 1 lakh records
14. API versioning
15. Retry mechanism
16. Timeout handling
17. Rate Limiter
18. URL Shortener
19. Payment System Design
20. Distributed Cache
21. Distributed Locking
22. Request Tracing
23. Monitoring and Logging
24. Handling 1M transactions
25. Consistency across services
Kafka
1. Apache Kafka
2. Kafka Producer
3. Partition Key
4. Event Streaming
5. Topics and Partitions
6. Offsets
7. Consumer Group
8. Message Ordering
9. Replication Factor
10. Leader vs Follower
11. ISR
12. Broker failure
13. acks=0 vs 1 vs all
14. Idempotent Producer
15. Duplicate message handling
16. Consumer Rebalancing
17. Auto Offset Reset
18. earliest vs latest
19. DLQ
20. Retry failed messages
21. Consumer performance tuning
22. Consumer Lag
23. Debugging lag
24. Retention Policy
25. Log Compaction
26. Fault Tolerance
27. Partition scalability
28. KafkaTemplate
29. @KafkaListener
30. Exactly Once Semantics
31. At Most/Least Once
32. Kafka Streams
33. Kafka vs RabbitMQ
34. Production issues in Kafka
35. Monitoring Kafka
SQL
1. 2nd Highest Salary
2. Nth Highest Salary
3. Remove duplicate records
4. Employees with same salary
5. WHERE vs HAVING
6. INNER JOIN vs LEFT JOIN
7. Department-wise max salary
8. Pagination LIMIT OFFSET
9. Duplicate rows
10. Count employees department-wise
11. Indexing
12. Composite vs Single Index
13. Query optimization
14. DELETE vs TRUNCATE vs DROP
15. Window Functions
16. ROW_NUMBER
17. RANK
18. DENSE_RANK
19. Stored Procedure employee list
Coding & Streams
1. Find duplicate elements
2. Remove duplicates
3. Character frequency
4. First non-repeated character
5. Second highest number
6. Highest salary employee
7. Sort employees by salary
8. Group employees by department
9. Count employees by department
10. Uppercase string list
11. Filter even numbers
12. Filter odd numbers
13. Numbers starting with 1
14. Ascending sort
15. Descending sort
16. Merge arrays
17. Common elements between lists
18. Reverse words
19. Word frequency
20. Longest string
21. Shortest string
22. List to Map
23. Total salary
24. Average salary department wise
25. Partition employees by salary
26. Max and Min
27. Optional empty check
28. List to int[]
29. flatMap nested list
30. Sort map by values
31. Top 3 highest numbers
32. Skip first 5 elements
33. Palindrome list
34. reduce sum
35. Comma separated string
36. Salary greater than average
37. Balanced Parentheses
38. LRU Cache
39. Thread-safe Singleton
40. Immutable class
41. Anagram program
42. Producer Consumer coding
43. Rate limiter coding
Docker & Kubernetes
1. Deploying microservices using Docker
2. Docker basics
3. Dockerfile
4. Container vs Image
5. Kubernetes Pods
6. Deployments
7. Services
8. ConfigMaps
9. Secrets
10. Ingress
11. Horizontal Pod Autoscaling