Microservices Architecture and Service Decomposition Questions
Decomposing a system into services along bounded contexts, defining service boundaries and ownership, and managing the tradeoffs against a monolith. Covers cohesion, coupling, data ownership per service, the distributed-monolith anti-pattern, and when a modular monolith beats microservices. Emphasizes decomposition reasoning rather than any single framework.
Define a framework for deciding HOW to decompose a system into services: by business domain (Domain-Driven Design), by technical surface area (e.g. data-store boundaries), or by team boundaries. Explain the trade-offs of each axis in terms of coupling, deployment independence, cognitive load, and cross-cutting concerns like auth and logging. Apply your framework to a concrete product (for example one with billing, user management, and content delivery) and justify the decomposition you'd choose.
Sample Answer
Direct answer
There are three common axes for deciding how to decompose a system into services: by business domain (Domain-Driven Design's bounded contexts), by technical surface area (splitting along data-store or infrastructure boundaries), or by team boundaries (whoever owns a piece of functionality gets a service). Business-domain decomposition is the default that ages best, because it tracks how the business actually changes over time; the other two axes are useful corrective signals, not primary decomposition strategies on their own.
Structured elaboration
Each axis optimizes for something different, and each has a failure mode when used alone. Business-domain decomposition (what does billing mean, what does user management mean, what does content delivery mean, each becoming its own service with its own data) tends to produce services whose boundaries stay stable even as the implementation underneath changes, because business concepts change more slowly than code. Technical-surface decomposition (split wherever the data store or infrastructure naturally differs, for example an analytics pipeline that needs a column store versus an online-transaction-processing (OLTP) path that needs a row store) is a good secondary signal, since forcing two workloads with very different infrastructure needs into one service creates real operational friction, but decomposing purely along technical lines without regard to the business concept tends to produce services that don't map to anything a product manager or a new engineer can reason about. Team-boundary decomposition (whoever owns it gets a service) optimizes for deployment autonomy and follows Conway's Law directly, but used alone it tends to fragment a single business concept across several services just because the org chart happened to split that way, creating coordination overhead between services that should have been one.
Worked example
Applying this to a product with billing, user management, and content-delivery features: billing and user management are natural, stable business-domain boundaries, each becoming its own service with a clear owner. Content delivery is more of a technical-surface concern (the actual bottleneck is serving large media efficiently, which pulls in content-delivery-network (CDN) and caching infrastructure decisions that don't map neatly to a single business domain); treating it as its own service is justified less by "it's a distinct business capability" and more by "it has a genuinely different infrastructure and scaling profile from the rest." If the org later splits user management across two teams (one for authentication, one for profile data) without a real business reason for the split, that's the team-boundary axis fragmenting a domain that should stay together, and it's worth pushing back on.
Trade-offs and pitfalls
The most common decomposition mistake is applying the technical-surface or team-boundary axis as the primary driver instead of a secondary check, producing services with unclear ownership from a product perspective, or services whose boundary exists only because two teams happen to sit in different parts of the org chart. Coupling shows up differently depending on the axis: business-domain decomposition risks under-splitting a domain that's actually grown too large for one team; technical-surface decomposition risks over-splitting a coherent business concept across several infrastructure-driven services; team-boundary decomposition risks mirroring org chart churn directly into architecture churn. The practical fix in all three cases is the same: use business domain as the default lens, and only cross it with the other two axes when there's a concrete, measurable reason (a genuinely different infrastructure need, or a genuinely different release cadence for a sub-piece of the domain).
Explain Conway's Law and how it shows up when an organization adopts microservices. Describe three organizational changes (for example small, autonomous 'two-pizza' teams each owning a clear set of services) you would make to reduce accidental coupling between teams and let services evolve independently.
Sample Answer
Direct answer
Conway's Law says a system's architecture ends up mirroring the communication structure of the organization that built it; in a microservices context, this shows up as service boundaries that quietly track team boundaries whether or not that was the intended design, so if you want a specific target architecture, you generally need to shape the team structure to match it rather than assuming the architecture will emerge independently of how teams are organized.
Structured elaboration
Three organizational changes that reduce accidental coupling and improve autonomous service evolution: first, form small, autonomous teams (a widely-cited heuristic is a team small enough to be fed by two pizzas) each owning a clear, bounded set of services end to end, rather than teams organized around a technical layer (a shared "backend team" and a shared "frontend team" both touching every service) which forces every feature to be coordinated across teams regardless of the service boundaries drawn in code. Second, minimize cross-team dependencies deliberately when assigning ownership: if two teams frequently need to coordinate a release because their services are tightly coupled, that's a signal either the team boundaries or the service boundaries are misaligned, and it's worth revisiting one or the other rather than accepting the coordination cost as permanent. Third, give each team clear, stable API contracts with its neighbors and make changing those contracts an explicit, versioned process, so teams can evolve their own service's internals freely without needing to coordinate every change with every consumer.
Worked example
A "two-pizza team" owning the Orders service end to end (its API, its database, its on-call rotation) can ship a change to Orders on its own schedule as long as it keeps its published contract stable; if instead "Orders logic" is split across a services team and a database team, any change to Orders requires coordinating both teams' schedules, which is Conway's Law producing exactly the coordination overhead microservices were meant to remove. Aligning ownership of a service to a single product-focused team, rather than splitting ownership by technical layer, is what makes services genuinely independently deployable in practice, not just on an architecture diagram.
Trade-offs and pitfalls
The common failure is drawing service boundaries on a diagram that look clean and independent, while team structure remains organized by technical layer or by legacy reporting lines that don't match those boundaries; the architecture on paper and the architecture the org actually produces (per Conway's Law) diverge, and the diagram loses. The forcing function that actually works is changing team ownership to match the intended service boundaries, or changing the service boundaries to match a team structure the org has already committed to, rather than trying to hold the two independent of each other.
For a 100-engineer organization, propose a team-ownership model for a large microservice landscape. Compare 'service-per-team', 'feature teams that share services', and a dedicated platform-team model, covering governance, shared libraries, and how cross-team changes get made under each.
Sample Answer
Direct answer
For a 100-engineer organization, the three common team-ownership models are service-per-team (each team owns a small, dedicated set of services end to end), feature teams sharing services (cross-functional teams that ship features but don't uniquely own the services they touch), and a dedicated platform team (owning shared infrastructure that every other team builds on); most organizations at this size end up needing a combination, service-per-team for product-facing services plus a platform team for shared concerns, rather than picking one model exclusively.
Structured elaboration
Service-per-team gives the clearest accountability (one team, one on-call rotation, one release cadence per service) and the strongest Conway's Law alignment, but it can lead to duplicated effort across teams solving similar infrastructure problems independently, and it struggles when a feature genuinely needs coordinated changes across several services owned by different teams. Feature teams sharing services optimize for shipping cross-cutting product features quickly, since a team can touch whatever services a feature needs without waiting on another team's roadmap, but they create ambiguous ownership (who's on-call when a shared service breaks, whose roadmap does a needed change compete against) and tend to erode the clean boundaries a service-per-team model would otherwise maintain. A platform-team model centralizes shared infrastructure (deployment pipelines, observability, core libraries) so product teams don't each reinvent it, but if under-resourced relative to demand, it becomes a bottleneck every other team is waiting on.
Worked example
A workable combination at 100 engineers: organize the majority of engineers into a handful of product-facing teams, each owning a small, clear set of services end to end (service-per-team for ownership and on-call clarity), carve out one platform team (perhaps 10-15% of headcount) providing the shared deployment, observability, and core-library tooling every product team depends on, and use temporary, cross-team "feature squads" only for genuinely cross-cutting initiatives that need coordinated changes across several product teams' services, disbanding them once the initiative ships rather than making shared, ambiguous ownership permanent.
Trade-offs and pitfalls
Governance needs to track which model a given piece of work actually fits: a well-understood, product-facing feature fits cleanly inside one team's service-per-team ownership; a genuinely cross-cutting initiative (say, adding a new compliance requirement across every service) needs either a temporary cross-team squad or, if it recurs often enough, its own dedicated team. Shared libraries are a common pitfall regardless of model: without a clear owner and a versioning discipline, a shared library becomes either everyone's problem (nobody prioritizes fixing it) or a de facto dependency that quietly recouples otherwise-independent services, since a breaking change to the shared library now has to be coordinated across every team using it, the same coordination cost service-per-team was meant to avoid.
Behavioral: describe a time you participated in an incremental migration or large refactor in production, such as extracting a service from a monolith. Outline the objective, the incremental steps you proposed, how you minimized user impact, the testing and monitoring you put in place, how you measured success, and what you would do differently in hindsight.
Sample Answer
Direct answer
Behavioral answer skeleton: describe a real incremental migration or large refactor (extracting a service from a monolith is a natural example), the specific staged approach taken to minimize user impact, the testing and monitoring that gave confidence at each stage, how success was measured, and one honest thing that would be done differently with hindsight.
Structured elaboration
A strong answer names the objective concretely (what was being migrated and why, in a sentence or two, not a vague "we modernized our architecture"), then walks through the incremental steps actually taken: how the work was sliced into stages small enough to ship and verify independently, rather than as one large, high-risk cutover. The user-impact-minimization piece should be specific: a canary rollout to a small percentage of traffic first, feature-flagging the new path so it could be turned off instantly if something went wrong, or scheduling the highest-risk step during a low-traffic window. Testing and monitoring should name what was actually watched (error rates, latency, a specific business metric that would flag a regression) rather than a generic "we tested it thoroughly." Success measurement should be a real number or outcome the candidate can speak to concretely (deploy frequency for the migrated piece went up, or a specific class of incident stopped recurring), and the hindsight reflection should be a genuine, specific lesson (something that was underestimated, or a step that, in retrospect, should have been smaller or better instrumented), not a soft non-answer like "communication could always be better."
Worked example
A representative version of this story: extracting a reporting module from a monolith because its long-running queries were periodically degrading the monolith's main request path. The staged approach: first, the new reporting service ran in parallel reading from a read replica (not the primary database), verified against the old reporting output for several weeks before anyone relied on it, then a feature flag switched a small internal team over first, followed by a gradual rollout to the rest of the org, with the old reporting code path kept alive as a fallback the whole time. Monitoring watched query latency on the primary database (the original problem) and a diff between old and new reporting outputs during the parallel-run period. Success was measured by the primary database's query latency returning to baseline once reporting traffic moved off it, and by the absence of any reported discrepancy in the parallel-run comparison. The hindsight lesson: the parallel-run comparison period was cut short by a week under schedule pressure, and a data discrepancy that surfaced shortly after full rollout would likely have been caught during a longer comparison window; with hindsight, that comparison period should have been held to its original length regardless of the schedule pressure.
Trade-offs and pitfalls
A behavioral answer to this question fails when it stays at the level of "we followed best practices" without a specific staged plan, a specific thing that was monitored, or a specific, non-generic lesson learned; interviewers are listening for evidence the candidate actually owned the risk-reduction decisions (why this stage, why this rollout order) rather than reciting the general shape of a migration.
What responsibilities does an API Gateway typically centralize for a microservices architecture? List the cross-cutting concerns it usually handles (routing, authentication, rate limiting, TLS termination, request/response transformation) and explain what problem having one entry point solves that having every client call every service directly would not.
Sample Answer
Direct answer
An API gateway centralizes the cross-cutting concerns that every client-facing request needs handled the same way, so individual services don't each have to reimplement them: routing requests to the right backend service, authenticating the caller, enforcing rate limits, terminating TLS, and doing basic request/response shaping, all in one place at the edge of the system.
Structured elaboration
Routing means the gateway is the single entry point clients call, and it decides which backend service actually handles a given request based on the path or other request attributes, so clients don't need to know the internal service topology or how it changes over time. Authentication centralizes verifying who's calling (validating a token or API key) once, at the edge, rather than every individual service independently re-implementing token validation. Rate limiting enforces per-client or per-API-key usage limits at the edge before a request even reaches a backend service, protecting every service behind the gateway from a single abusive or misbehaving caller without each service needing its own limiting logic. TLS termination handles the encryption/decryption overhead for external traffic in one place rather than in every service. Request/response transformation covers lighter-weight shaping, like aggregating a few backend calls into one client-facing response, or adapting an older API shape for backward compatibility, without every service needing to handle those concerns itself.
Worked example
Without a gateway, if a client needed to call five different backend services directly, each of those five services would need its own authentication logic, its own rate limiting, its own TLS termination, and the client would need to know all five service addresses and how they change; a gateway collapses that to one well-known entry point, one place to update authentication logic when it needs to change, and one place to see aggregate traffic and enforce limits across the whole surface a client touches.
Trade-offs and pitfalls
The most common mistake is treating the gateway purely as a routing proxy and skipping the cross-cutting concerns it's actually valuable for (authentication, rate limiting), which leaves each backend service to reimplement them inconsistently. The opposite mistake is overloading the gateway with business logic that belongs in a backend service (like assembling a complex, service-specific business response rather than a light aggregation), which turns the gateway itself into an operationally risky single point of coupling for logic that should be independently deployable elsewhere.
Unlock Full Question Bank
Get access to all 37 Microservices Architecture and Service Decomposition interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.