Java Microservices Interview Questions 2026 Experience: 3 to 6 Years
Java Microservices Interview Questions 2026
Experience: 3 to 6 Years𝗖𝗢𝗥𝗘 𝗝𝗔𝗩𝗔:
1. Fail-fast vs fail-safe iterators.
2. How does ConcurrentHashMap work internally?
3. What happens when a thread pool’s work queue reaches capacity?
4. What are the consequences of using a mutable object as a HashMap key?
5. Explain SOLID principles with a real-world example.
6. Optional: orElse() vs orElseGet().
7. Your service throws OutOfMemoryError in production. What are your first diagnostic steps?
8. Virtual threads: when do they improve scalability, and where do they fall short?
𝗦𝗣𝗥𝗜𝗡𝗚 𝗕𝗢𝗢𝗧 𝗔𝗡𝗗 𝗠𝗜𝗖𝗥𝗢𝗦𝗘𝗥𝗩𝗜𝗖𝗘𝗦:
1. How does JWT-based authentication work?
2. What is the difference between OAuth2 and JWT?
3. RestTemplate vs WebClient vs RestClient.
4. How do microservices communicate with each other?
5. What is the role of an API Gateway?
6. How do you implement global exception handling in Spring Boot?
7. How does @Transactional work internally?
8. Why does @Transactional fail on self-invocation within the same class?
𝗞𝗔𝗙𝗞𝗔 𝗔𝗡𝗗 𝗠𝗘𝗦𝗦𝗔𝗚𝗜𝗡𝗚:
1. Why choose Kafka over RabbitMQ?
2. How do partitions work?
3. What happens if a consumer crashes mid-batch?
4. How do you guarantee message ordering?
5. How do you design an idempotent consumer?
6. What is a Dead Letter Queue, and when should you use one?
𝗗𝗔𝗧𝗔𝗕𝗔𝗦𝗘 𝗔𝗡𝗗 𝗝𝗣𝗔:
1. First-level vs second-level cache in Hibernate.
2. What is the N+1 problem?
3. How do you identify and optimize a slow query?
4. How do you handle concurrent updates to the same row?
𝗦𝗬𝗦𝗧𝗘𝗠 𝗗𝗘𝗦𝗜𝗚𝗡:
1. Design a payment system.
2. How would you scale to handle 1 million transactions per hour?
3. Saga vs 2PC.
4. What is the Transactional Outbox pattern, and why is it needed?
5. In a database-per-service architecture, how do you run a query spanning two services?
6. How does distributed locking work?
𝗣𝗥𝗢𝗗𝗨𝗖𝗧𝗜𝗢𝗡:
1. Blue-green vs canary deployment.
2. What is a circuit breaker?
3. How do you implement API rate limiting?
4. How do you trace a single request across six services?
Comments
Post a Comment