Java Interview questions on Web Services and Microservices

Neeru K Singh
4 min readFeb 18, 2023

--

  1. What is the difference between SOAP-based web services and REST-based web services?
  2. What is SOAP Envelope?
  3. How to implement security in RESTful web service?
  4. How to manage Transactions across REST microservices? — click here
  5. What is Payload in REST?
  6. What is Microservices?
  7. What is difference between Microservices and REST?
  8. What is difference between Monolithic and Microservices?
    hint — development, one vs many, latency, deployment
  9. What problem does SAGA pattern solve?
    hint — distributed transactions
  10. What is service discovery in Microservices?
  11. What are common Microservices Pattern you have used in your project?

11. What is a Microservices architecture and how does it differ from a monolithic architecture?

12. What are the benefits and drawbacks of a Microservices architecture? Pros and Cons?

13. How to design and implement a Microservices?.

14. What are the key characteristics of a well-designed Microservice?

15. How to ensure that Microservices are loosely coupled and highly cohesive?

16 .How does a Java Microservice and .NET Microservice can talk with teach? (hint json)

17. How to handle cross-cutting concerns, such as security, in a Microservices architecture?

18. Why debugging is so tough on Microservice Architecture?

19. How to handle data consistency in a Microservices architecture?

20.How do you ensure that Microservices are scalable and resilient?

21.How to handle service discovery and registration in a Microservices architecture?

22.How to handle service communication and data sharing in a Microservices architecture?

23.How to handle service versioning and backward compatibility in a Microservices architecture?

24.How to monitor and troubleshoot Microservices?

25.How to handle deployments and rollbacks in a Microservices architecture?

26.How to handle testing and continuous integration in a Microservices architecture?

27. How to handle service governance and lifecycle management in a Microservices architecture?

28.How to handle security and access control in a Microservices architecture?

29.Howdo you data integration and data migration in a Microservices architecture?

30.How to handle service composition and orchestration in a Microservices architecture?

31.How do you deploy your Java Microservices?

32.How to handle service resiliency in case of failures?

33.What are Java Frameworks you can use to create Microservices?
hint — Quarkus, Spring Boot, and MicroNaut

34. How many Microservices you have in your project? How do you find if a user says that one of his order is missing in databsae?
hint — one database per microservice is a pattern

35. Where will you use an event driven system? How does an event driven system work? Describe it by taking an example.

36. Any of the MicroService Design Pattern which you have used?

37. How to handle fallback in Microservices?

38. What are the three state in Hystrix and explain them?

39. What is Distributed tracing in Microservices and how to implement them?

40. What do you understand about Api Gateway?

41. How to handle Service Discovery using Netflix Eureka?

42. What are common Problems in Message Queues ?- click here

43. What are common Problems in Distributed Systems and their Solutions ?- click here

Microservices Interview Questions on Design Patterns and Principles

  1. Can you Explain Circuit Breaker pattern and how is it used to handle service failures in Microservices architecture? What problem does it solve.

2. What is Command Query Responsibility Segregation (CQRS) pattern and when is it appropriate to use in Microservices architecture?

3. What is retry pattern in Microservices? When and how to use it?

4.Can you Explain Event-Driven pattern and how is it used in Microservices architecture?

5.Can you Explain Service Registry pattern and how is it used in Microservices architecture?

6.Can you Explain Sidecar pattern and how is it used in Microservices architecture?

7.Can you Explain Service Mesh pattern and how is it used in Microservices architecture?

8.Can you Explain Backend for Frontend pattern and how is it used in Microservices architecture?

9.Can you Explain Bulkhead pattern and how is it used in Microservices architecture?

10.What is Saga pattern? What problem does it solve?

11.Can you Explain Outbox pattern and how is it used in Microservices architecture?

12.What is Self-Containment pattern and how is it used in Microservices architecture?

13.Can you Explain External Configuration pattern and how is it used in Microservices architecture?

14.What is Strangler pattern and how is it used in Microservices architecture?

Advanced Microservices Interview Questions for Experienced Developers

  1. How to data partitioning and data replication in MS?
  2. Have you done any service partitioning and service scaling in a microservices architecture? If not, how can you do it?
  3. Explain service orchestration and service choreography in a microservices ?
  4. What challenges have you faced while developing a Microservices in your project?
  5. How do you handle service security and service encryption in a microservices?
  6. How will you implement service monitoring and service logging in a microservices architecture?
  7. How do you handle service tracing and service debugging in a microservices architecture?
  8. What is service testing and service quality assurance in a microservices architecture?
  9. How do you handle service deployment and service rollback in a microservices architecture?
  10. How do you handle service governance and service lifecycle management in a Microservices Architecture?
  11. How do you handle service migration and service modernization in a microservices architecture?
  12. How do you handle service integration and service API management in a microservices architecture?
  13. How do you handle service performance and service optimization in a microservices architecture?
  14. How will you make sure that your Microservices is not affecting other Microservices in the same host?
  15. How do you organize your Microservices? Does all code remain same repo or you create multiple repo for different Microservices?
  16. What is better? Different database for different Microservice or single database for all Microservices? and Why?

If you liked the article, please don’t forgot to clap and follow me for more such articles. Please let me know in the comments if you have any suggestion or solution.

Happy Reading !!!

--

--