Architecture Styles
| Style | Main Idea |
|---|---|
| Monolith | One deployable application containing most features |
| SOA | Services communicate, often with enterprise-level shared infrastructure |
| Microservices | Small autonomous services modeled around business capabilities |
Microservice Challenges
Microservices improve independent deployment and scaling, but they add distributed-system complexity. Common challenges include service discovery, observability, configuration management, debugging, network failures, data consistency, and deployment automation.
Common Tools
Docker packages a service and its dependencies into a portable container image. Kubernetes orchestrates containers with scheduling, scaling, service discovery, and self-healing. Spring Boot helps Java teams build production-ready services quickly.
Interview Framing
Do not present microservices as automatically better. Explain that they help when organizational and scaling needs justify the operational cost.
Interview Scenario Practice
Scenario 1: Split a Monolith
Scenario: A monolith has user, order, payment, and notification features. The team wants microservices.
Strong answer: Split by business capability, not by technical layer. Start with clear boundaries such as Orders, Payments, and Notifications, then define APIs, data ownership, and deployment ownership.
Why it works: Microservices need autonomy. A service that owns no data or business capability becomes distributed coupling.
Common mistake: Creating separate controller, service, and repository services. That turns local method calls into network calls without business value.
Scenario 2: Debugging Across Services
Scenario: A checkout request fails after calling four services.
Strong answer: Use centralized logs, correlation IDs, metrics, traces, and clear service-level dashboards.
Why it works: Distributed systems need observability because the failure path crosses process boundaries.
Common mistake: SSHing into individual containers and manually reading logs as the primary debugging strategy.
Scenario 3: Service Deployment
Scenario: One service needs a new version while others should continue running.
Strong answer: Containerize each service, deploy independently, and use backward-compatible APIs or versioning during rollout.
Why it works: Independent deployment is one of the main reasons microservices can help larger teams.
Common mistake: Requiring every service to deploy together, which recreates monolith-style release coupling.