Test your knowledge of microservices concepts, architecture, scalability, and best practices commonly discussed in interviews.
Definition of Microservices
Which statement best describes microservices architecture?
- A technique for compressing software images.
- A single application built as a group of small, independent services.
- A user interface design pattern for mobile apps.
- A type of server hardware used in cloud computing.
- A database optimization strategy for faster queries.
Decentralized Data
In a microservices architecture, how is data typically managed?
- Each service manages its own database.
- Data is always stored on client devices.
- Data is stored as spreadsheets in the cloud.
- All services share one large global database.
- Only the main API service accesses the database.
Independent Deployment
What does it mean when microservices are 'independently deployable'?
- The entire application must be redeployed for any change.
- Services can only be deployed together as a bundle.
- Deployments are managed by client-side code.
- Individual deployments require manual code merges each time.
- Each service can be updated without redeploying the whole system.
Communication Protocols
Which protocol is commonly used for communication between microservices?
- SMTP
- REST
- FTP
- PPTP
- IMAP
Monolithic vs Microservices
How does a monolithic architecture differ from microservices?
- It eliminates the need for deployment.
- It always uses multiple databases.
- It never scales horizontally.
- It requires REST for communication.
- It uses a single codebase for all components.
Fault Isolation
Why is fault isolation a key benefit of microservices?
- Services can never fail in this architecture.
- Faults automatically fix themselves.
- All errors crash the entire application.
- Services must share the same error logs.
- A failure in one service does not impact other services.
Scalability
How do microservices enable better scalability compared to monolithic systems?
- Scaling is done only at the database level.
- Individual services can be scaled based on their own workloads.
- Services cannot be scaled separately.
- All services must scale in equal proportions.
- Scalability is managed only by hardware upgrades.
Domain-Driven Design
What role does Domain-Driven Design (DDD) play in microservices?
- It controls database indexing strategies.
- It manages thread pools for concurrency.
- It helps define clear service boundaries based on business domains.
- It is responsible for service logging.
- It is used only for designing user interfaces.
Continuous Delivery
Which statement best describes the relationship between microservices and continuous delivery?
- Microservices are well suited for continuous delivery because services can be updated independently.
- Updates to one service require downtime for all others.
- Continuous delivery is not possible with microservices.
- Only monolithic architectures allow frequent releases.
- Every microservice must be delivered manually.
Lightweight Communication
Why is lightweight communication preferred in microservices?
- It eliminates the need for API documentation.
- It requires heavier frameworks for data transfer.
- It reduces network overhead between services.
- It slows down service integration.
- It only supports synchronous calls.
Service Discovery
What is the main purpose of service discovery in microservices?
- It helps services dynamically locate each other on the network.
- It logs all error messages for debugging.
- It compresses API responses for faster delivery.
- It secures data stored in microservices.
- It manages user authentication.
API Gateway
Why is an API gateway commonly used in microservices architectures?
- It stores all application data centrally.
- It performs code compilation for all services.
- It deploys client applications automatically.
- It is only used for database migrations.
- It routes client requests to the appropriate service.
Loose Coupling
What does 'loose coupling' mean in the context of microservices?
- All service updates require a complete system restart.
- No service utilizes external communication.
- Services interact with minimal dependencies on each other.
- All services share common internal variables.
- Services are bundled in one code repository.
Security in Microservices
Which approach is commonly used to secure communication between microservices?
- Allowing open access to all services.
- Sharing passwords over unencrypted channels.
- Using tokens for authentication and encryption.
- Storing credentials in public configuration files.
- Managing security only at the user interface level.
Microservices Example
If an online shop application is built using microservices, which is a valid example of a single service?
- The entire checkout, payment, and shipping system together.
- An email inbox for the admin only.
- The full website frontend.
- An independent inventory management module.
- A detailed report about all user orders.