Monoliths vs Microservices Interview Questions
261 multiple-choice tech interview questions on Monoliths vs Microservices: monoliths and modular monoliths, microservice boundaries, communication, data ownership, distributed transactions and sagas, operational costs, migration. Written for technical phone screens and interview prep, organized by subtopic, with a short explanation for every answer. Learn the 74 key terms with the flashcards first, then test yourself.
Take the practice test · Flashcards · All study tools
What it covers
- 2.1 Monoliths, modular monoliths and when to split
- 2.2 Service boundaries, sizing and team ownership
- 2.3 Communication styles and service contracts
- 2.4 Data ownership and cross-service queries
- 2.5 Service discovery, configuration and runtime platform
- 2.6 Testing microservices
- 2.7 Build, deployment and versioning per service
- 2.8 Observability, operations and cost
- 2.9 Migration, decomposition and anti-patterns
Key terms
2.1 Monoliths, modular monoliths and when to split
- Monolith
- An application built and deployed as a single unit
- Modular monolith
- One deployable app divided into well-bounded internal modules
- Conway's law
- Systems mirror the communication structure of the organizations that build them
- Modulith
- A modular monolith with enforced boundaries
- Majestic monolith
- A single well-built app, preferred over premature splitting
- Monolith first
- Start with a monolith and split once boundaries are clear
- Deployment unit
- What is built and released as one piece
- Modular monolith public API
- The few types other modules may use
2.2 Service boundaries, sizing and team ownership
- Microservice
- Independently deployable service that owns its data and one business capability
- Distributed monolith
- Separately deployed services that must still change and release together
- Two-pizza team
- A team small enough to be fed by two pizzas
- Platform team
- A team offering self-service tools to other teams
- Cognitive load
- How much a team must hold in mind to own its systems
- Nanoservice
- A service too small to justify its overhead
- Enabling team
- A team that coaches others in new skills, then steps back
- Complicated-subsystem team
- Specialists owning a part needing deep expertise
- X-as-a-Service
- One team consuming another's offering with little contact
- Deployment coupling
- Services that must be released together
- Domain coupling
- One service relying on another's business capability
2.3 Communication styles and service contracts
- Saga
- Sequence of local transactions with compensating actions for multi-service consistency
- Circuit breaker
- Pattern that stops calling a failing dependency for a while
- Chatty interface
- An API needing many calls for one task
- Coarse-grained API
- An API doing a whole task per call
- Deadline propagation
- Passing a remaining time budget to downstream calls
- Async request-reply
- Accept a request, then report the result later
- Robustness principle
- Be conservative in what you send, liberal in what you accept
- Fan-out
- One request spreading into calls to many services
- API-first design
- Agreeing a contract before building either side
- Bulk endpoint
- An API returning many items by ID in one call
2.4 Data ownership and cross-service queries
- Database per service
- Each service exclusively owns its data store
- API composition
- Querying several services and joining in memory
- Source of truth
- The one service that owns and writes a piece of data
2.5 Service discovery, configuration and runtime platform
- Service discovery
- Finding where a service's instances currently run
- Service registry
- A database of live service instances
- Client-side discovery
- The caller looks up instances and picks one
- Server-side discovery
- A router looks up instances for the caller
- Ambassador pattern
- A proxy that handles a service's outbound calls
- Dapr
- A sidecar runtime offering microservice building blocks
- Externalized configuration
- Config kept outside the build artifact
- SPIFFE
- A standard for secure workload identity
- Internal developer platform
- Self-service tooling for building and running apps
- Config server
- A central service that hands config to apps
2.6 Testing microservices
- Pact
- A consumer-driven contract testing tool
- Can-i-deploy
- A Pact Broker check for safe deploy compatibility
- Component test
- Testing one service alone with fakes for others
- Ephemeral environment
- A short-lived environment created per change
- Synthetic transaction
- A scripted user journey run against live systems
- Service virtualization
- Simulating a dependency's behavior for tests
- Traffic shadowing
- Copying live requests to a new version without using its replies
- Contract drift
- Stubs that no longer match the real provider
- Shadow traffic
- Copied live requests sent to a new version
2.7 Build, deployment and versioning per service
- Monorepo
- One repository holding many projects' code
- Polyrepo
- A separate repository per service
- Rolling deployment
- Replacing instances gradually
- GitOps
- Git holding desired state that agents apply
- SLSA
- A framework of supply-chain integrity levels
- Version skew
- Peers running mismatched versions at once
- Pipeline template
- A shared CI/CD definition reused across services
- Deprecation policy
- Rules for how long old API versions live
2.8 Observability, operations and cost
- Trace Context
- The W3C standard for passing trace IDs in headers
- Service map
- A graph of which services call which
- Microservice chassis
- A shared framework for cross-cutting concerns
- Service template
- A starter repo with standard tooling built in
- Service tiering
- Ranking services by criticality
- Cost per request
- A service's cloud cost divided by requests served
2.9 Migration, decomposition and anti-patterns
- Strangler fig pattern
- Incrementally replacing a legacy system feature by feature
- Backend for frontend
- API layer tailored to one client type
- Branch by abstraction
- Add an abstraction, build the new path, then switch
- Parallel run
- Running old and new together and comparing results
- Transitional architecture
- Temporary parts that ease moving to a target design
- Microservices premium
- The extra cost and effort microservices require
- Golden master test
- Comparing new outputs to recorded old outputs
- Event interception
- Capturing old-system changes to feed a new service
- Re-merge
- Combining services back when a split didn't pay off
Sample practice questions
What is a monolith?
- An application that can only run on a mainframe
- An application built and deployed as one unit
- An application that doesn't use any database
- An application whose code is all in one file
Answer: B. An application built and deployed as one unit Monoliths are simple to build, test and deploy at first; problems appear as the team and codebase grow.
What does Conway's law state?
- Every system eventually grows into a single large monolith
- Adding people to a late software project makes it even later
- Systems mirror the communication structure of the organization
- The size of a codebase doubles roughly every two years
Answer: C. Systems mirror the communication structure of the organization The "inverse Conway maneuver" shapes teams to get the architecture you want.
What is a key drawback of synchronous HTTP chains between many services?
- HTTP isn't able to carry JSON payloads between services
- They're always faster than in-process calls, which hides bugs
- They make independent deployment of the services impossible
- Latency adds up, and any failing service fails the whole request
Answer: D. Latency adds up, and any failing service fails the whole request Prefer asynchronous events where possible, and use timeouts, retries and circuit breakers.
Why do microservices usually avoid sharing a database?
- Shared schemas couple services and defeat independent deployment
- Databases can't handle connections from more than one service
- Sharing a database between services is prohibited by regulation
- A shared database is always more expensive than many small ones
Answer: A. Shared schemas couple services and defeat independent deployment Each service owns its data and exposes it through APIs or events.
What is a service mesh's role in a microservice platform?
- Replacing the API gateway, but only for requests from external clients
- Storing each service's data in a shared, replicated database
- Compiling each service's source code into a container image
- Handling mTLS, retries, traffic shifting and telemetry outside app code
Answer: D. Handling mTLS, retries, traffic shifting and telemetry outside app code Istio, Linkerd and Cilium are examples.
Why are end-to-end tests across many services costly?
- They're slow, flaky and need full environments
- They can't be automated in any CI tool
- They only test one service at a time
- They require writing tests in Assembly
Answer: A. They're slow, flaky and need full environments Keep them few.
Why does each microservice usually get its own CI/CD pipeline?
- Because CI tools can't handle more than one app
- So it builds and deploys independently
- So each team must use a different CI vendor
- Because shared pipelines are illegal
Answer: B. So it builds and deploys independently Independent delivery.
Why do microservices need distributed tracing more than monoliths?
- Monolithic applications aren't able to write any logs, so tracing fills the gap
- Distributed tracing replaces all logging, which microservices aren't able to do
- One request crosses many services, so trace IDs show where it's slow or fails
- Microservices never fail, so tracing is only used to measure their speed
Answer: C. One request crosses many services, so trace IDs show where it's slow or fails OpenTelemetry provides vendor-neutral tracing.
What is a "distributed monolith"?
- A monolithic application that's hosted in several regions at once
- A monolith that serves its static assets through a CDN
- A single microservice that uses a message queue internally
- Separately deployed services so coupled they must be released together
Answer: D. Separately deployed services so coupled they must be released together It has the costs of microservices and the drawbacks of a monolith.
What is a modular monolith?
- A monolith that's deployed as copies onto several servers
- One deployable split internally into modules with clear boundaries
- A set of microservices that all share a single database
- A monolith that has no internal modules or boundaries at all
Answer: B. One deployable split internally into modules with clear boundaries It gives many design benefits of microservices without distributed-system costs, and can be split later.
More Architecture
- System Design Interview Fundamentals
- Event-Driven Architecture
- Scalability: Horizontal and Vertical Scaling, Sharding and Partitioning
- CAP Theorem and Distributed Consistency
- High Availability and Fault Tolerance
- API Gateways and Service Meshes
- Domain-Driven Design
- Clean and Hexagonal Architecture
- Security Architecture: Zero Trust and OWASP Top 10
- AI and LLM Integration: RAG, Prompts and APIs