Interview prompt
Problem context
Skills being evaluated
Use the sequence below to surface constraints, choose boundaries, test failure behavior, and defend trade-offs. Concrete numbers are interview assumptions, not claims about a real production system.
Clarify the decision
- Identify whether the pain is deploy coupling, code ownership, runtime scaling, reliability, or team coordination. Map business domains and change dependencies before choosing process boundaries.
Establish scale assumptions
- Measure build and deploy time, change failure, cross-team file edits, database contention, and domain load. Runtime decomposition is not justified by team count alone.
Functional and non-functional requirements
- Teams need clear ownership and safer independent change, while preserving transactional correctness and current availability. Every extracted boundary needs a named operating team.
High-level architecture
- Build a modular monolith with domain packages, enforced dependency direction, stable internal APIs, ownership, test seams, and schema access rules. Extract only domains with distinct scaling, failure, or delivery needs through a strangler.
Data model and flow
- Route cross-domain commands through explicit interfaces and publish domain events through an outbox. Prohibit new direct table access across owners and inventory legacy access for removal.
Consistency and transaction boundaries
- Keep local transactions where invariants are naturally shared. Before extraction, define saga, reservation, or compensation semantics rather than accidentally distributing the transaction.
Failure modes and recovery
- Use deployment rings, feature flags, shadow paths, and per-domain observability. Extraction adds timeouts, retries, and partial failure, so prove the benefit exceeds new operational risk.
Security and privacy
- Make authorization and tenant context explicit at domain boundaries. A new network hop is not automatically a stronger security boundary.
Observability and SLOs
- Track dependency violations, domain change lead time, deploy failure, cross-team coordination, and incident ownership. Measure extraction outcomes against the original pain.
Capacity and cost
- Modularity is cheaper than a service fleet and often captures most organizational benefit. Price new on-call, environments, networking, and data duplication before extraction.
Alternatives and trade-offs
- A modular monolith retains shared-failure and deploy coupling but preserves simple transactions. Services buy independent scale and release at the cost of distributed operations; use them selectively.
Evolution and migration
- Establish ownership and dependency checks, untangle schemas, improve deployment, then extract one evidence-backed domain. Stop if the measurable outcome does not improve.
What Staff and Principal candidates should emphasize
- Senior candidates diagnose the bottleneck instead of accepting microservices as the goal. They align code and team boundaries, preserve invariants, and sequence reversible changes.
Decision trade-offs
First move
Option A
Split services around the current code layout
Option B
Enforce domain boundaries inside the monolith
Recommendation:Create semantic seams and ownership first; a process boundary around tangled code only makes coupling slower and less reliable.
Extraction trigger
Option A
Every team receives a service
Option B
Distinct scale, failure, data, or delivery need
Recommendation:Extract only when an independent operational boundary has measurable value and a team willing to own it.
Follow-up interview questions
- 01How do you stop teams from bypassing internal domain APIs?
- 02Which domain should be extracted first?
- 03What happens to shared database transactions?
- 04How do you know the evolution improved autonomy?
Common weak answers and mistakes
- 01Equating team autonomy with one microservice per team.
- 02Extracting code before untangling shared tables and invariants.
- 03Ignoring the on-call and platform cost of a service fleet.
- 04Declaring success by service count rather than delivery and reliability outcomes.
Interviewer evaluation rubric
Draws future microservices but cannot diagnose current coupling or sequence a safe migration.
Defines domains, ownership, modular boundaries, dependency checks, outbox events, and selective extraction.
Connects boundaries to team topology, transaction semantics, platform cost, measured outcomes, and stop conditions.
Uses organizational and technical evidence to preserve simplicity while creating durable options for later independent evolution.