
1. What are Microservices?
Answer
Microservices is an architectural style where an application is divided into small, independent services, each responsible for a single business capability, communicating via lightweight protocols (e.g., REST, gRPC, messaging).
2. What are the main benefits of Microservices?
Answer
Scalability (independent scaling of services)
Faster deployment (CI/CD friendly)
Technology flexibility (polyglot)
Resilience (failure isolation)
Better team ownership (service per team)
3. Difference between Monolith and Microservices?
Answer
Monolith → Single large codebase, tightly coupled, difficult to scale.
Microservices → Distributed, loosely coupled, independently deployable.
4. How do Microservices communicate?
Answer
Synchronous: REST, gRPC
Asynchronous: Message brokers (RabbitMQ, Kafka, Azure Service Bus)
5. What is API Gateway in Microservices?
Answer
API Gateway acts as an entry point for all requests, handling routing, load balancing, security, rate limiting, and logging. Example: Kong, NGINX, Azure API Management.
6. How do you handle service discovery?
Answer
Client-side: Eureka, Consul
Server-side: API Gateway + Load Balancer (e.g., Kubernetes Services, AWS ALB)
7. What is Circuit Breaker Pattern?
Answer
It prevents repeated calls to a failing service. If a service fails continuously, the breaker "opens" and stops traffic until it recovers. Example: Polly (.NET), Hystrix (Java).
8. What is the Saga Pattern in Microservices?
Answer
Saga manages distributed transactions by breaking them into smaller local transactions.
Choreography: Events trigger the next action.
Orchestration: Central controller manages flow.
9. How do you ensure data consistency in Microservices?
Answer
Event-driven design (event sourcing, Kafka)
Saga pattern
Idempotency in APIs
Eventual consistency
10. How do you handle the database per microservice?
Answer
Each microservice owns its own database to avoid coupling. For queries across services → use CQRS, API Composition, or Database Views.
11. What is CQRS?
Answer
Command Query Responsibility Segregation separates read (queries) and write (commands) models for performance and scalability.
12. What is Event Sourcing?
Answer
Instead of storing only the final state, every change is stored as an event. The state is rebuilt by replaying events. Useful for audit logs and financial transactions.

Amit Kumar SinghPosted Sep 7, 2025, 1:06 PM
Thank you for Informative Knowledge.