1. What are Microservices?
Microservices are a software architecture style where an application is broken into small, independent services.
Each service handles a specific task (like user service, payment service).
They can be deployed and scaled independently.
2. What is the main idea behind Microservices?
The idea is to break a large monolithic application into independent, smaller components.
This makes development faster, more scalable, and easier to maintain.
3. What is the difference between Monolithic and Microservices architecture?
| Monolithic | Microservices |
|---|---|
| One large codebase | Many small services |
| Hard to scale | Easily scalable |
| One deployment for everything | Each service deploys separately |
| Tight coupling | Loosely coupled |
4. Why are microservices popular?
Because they offer:
-
Faster development
-
Independent deployment
-
Scalability
-
Flexibility to use different tech stack
-
Better fault isolation
5. What is an API in microservices?
API (Application Programming Interface) allows communication between microservices using HTTP/REST, gRPC, etc.
6. What is an API Gateway?
A single entry point for all requests coming to microservices.
It handles:
-
Routing
-
Authentication
-
Rate limiting
-
Logging
Tools: Kong, Nginx, Zuul, API Gateway (AWS)
7. What is the purpose of Service Discovery?
It helps services find each other automatically.
Example tools: Eureka, Consul, Zookeeper
8. What is REST?
REST is a set of rules for building APIs using HTTP methods like GET, POST, PUT, DELETE.
9. What is statelessness?
In stateless services, the server does not store user session data.
Each request contains all required data.
10. What is a microservice? Give an example.
A small independent service that performs one function.
Example: Payment Service in an e-commerce app.
11. What is Containerization?
Packaging an application with its dependencies so it runs anywhere.
Tool: Docker
12. What is Docker?
A platform to build, run, and ship containerized applications.
13. What is Kubernetes?
A container orchestration tool used to manage, scale, and deploy containers.
14. What are advantages of Kubernetes in microservices?
-
Auto-scaling
-
Self-healing
-
Load balancing
-
Rolling updates
-
Service discovery
15. What is CI/CD?
A pipeline that automates:
-
Code building
-
Testing
-
Deployment
Useful for microservices because each service updates independently.
16. What is the role of DevOps in microservices?
DevOps helps automate deployments and monitoring for multiple services.
17. What is a message broker?
A tool used for asynchronous communication.
Examples:
-
Kafka
-
RabbitMQ
-
AWS SQS
Instead of direct calling, services send messages to queues.
18. What is asynchronous communication?
Services communicate without waiting for immediate responses.
Helps reduce latency and improve reliability.
19. What is synchronous communication?
One service calls another and waits for response.
Example: REST API calls.
20. What is a database-per-service pattern?
Each microservice has its own database.
This avoids tight coupling and makes services independent.
21. What is loose coupling?
Services are independent and do not depend heavily on each other.
22. What is tight coupling?
Services depend heavily on each other — common in monolithic apps.
23. What is scalability?
Ability to handle more load by adding more resources.
24. How do you scale microservices?
-
Increase service instances (horizontal scaling)
-
Use containers
-
Load balancing
25. What is a health check in microservices?
A ping or endpoint that tells if a service is running.
Example: /health or /status
26. What is logging in microservices?
Capturing service events for debugging.
Tools for centralized logging:
-
ELK Stack
-
Grafana Loki
-
Splunk
27. What is monitoring in microservices?
Tracking service health, CPU, memory, latency, etc.
Tools: Prometheus, Grafana
28. What is distributed tracing?
Tracing requests across multiple microservices.
Tools: Jaeger, Zipkin
29. What is a load balancer?
Distributes traffic across multiple instances of a microservice.
Tools: Nginx, HAProxy, AWS ALB
30. What is a microservices architecture example?
An e-commerce app broken into:
-
User service
-
Product service
-
Order service
-
Payment service
-
Inventory service
Each running independently.