🧩 Microservices Architecture — interview questions

12 questions. Filter by what the role asks for; open one for the six layers of the answer. The course is where the answers come from.

12 of 12

01Sales wants a `leadScore` field on `Customer` and Billing wants a `taxId` field, and someone proposes one `customers` service with one table holding both. What's the argument against, and what would you build instead?Boundarieseasy0-2y02A checkout method inside one `@Transactional` call reserves stock, sends a confirmation email, awards loyalty points and tracks analytics — four calls to four services. Which of these should stay synchronous, and what's the test for deciding?Communicationeasy0-2y03A mobile app currently calls eleven different service hosts directly, each with its own certificate and auth flow. What does putting an API gateway in front of them actually buy, and what's the test for whether a piece of logic belongs there?Gatewayeasy0-2y04"Orders with customer names" used to be one JOIN. Once orders and customers are separate services with separate databases, what are the actual options for that query, and why isn't "let orders read the customers table directly" one of them?Data ownershipmedium3-5y05A topic named `SendInvoiceEmail` is consumed by both the `email` service and an `audit` service. What's wrong with this design, and how do you tell an event from a command in general?Messagingmedium3-5y06An orders service calls a slow, non-critical reporting service and a fast, critical payments service, both from the same shared thread pool. Why does a bulkhead around each matter, and which Resilience4j bulkhead type — semaphore or thread-pool — fits which?Resiliencemedium3-5y07A caller uses a keep-alive HTTP client against a Kubernetes Service with five ready pods behind it, and one pod ends up receiving 80% of the traffic. Why, mechanically, and what fixes it at each layer?Discoveryhard5-8y08A payment provider's latency rose from 200ms to 6s for thirty seconds during their own failover. The checkout service had a 10-second read timeout and three retries with no backoff. Walk through why this became a two-hour outage, and name every configuration mistake.Resiliencehard5-8y09A caller runs 12 instances, each configured with a Resilience4j `RateLimiter` of 50 requests/second, to stay under a dependency's 600 req/s capacity. The caller then autoscales to 20 instances under load. What breaks, and what's the actual fix?Rate limitinghard5-8y10Three years into a platform, the shared API gateway has sixty-one custom filters, one of which runs a blocking JDBC query against the orders table to check whether an order is cancellable before proxying the request. What's wrong here beyond "it's slow", and how should this actually be structured?Gatewayhard5-8y11Two Resilience4j breakers misbehave in the same incident: `payments` (about 20 calls/minute, `minimumNumberOfCalls: 100`) never opens during a five-minute outage, and `search` (`slidingWindowSize: 10`, `permittedNumberOfCallsInHalfOpenState: 1`, `waitDurationInOpenState: 60s`) stays open for an hour after a two-second blip. Explain both mechanically, and fix each.Circuit breakerssenior8+y12A database password was rotated cleanly in Vault and synced to a Kubernetes Secret within the hour, yet the service went down thirty minutes later with `password authentication failed`. The password was injected via `env.valueFrom.secretKeyRef`. What actually happened, and what are the real fixes?Secrets & configurationsenior8+y