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

  1. 2.1 Monoliths, modular monoliths and when to split
  2. 2.2 Service boundaries, sizing and team ownership
  3. 2.3 Communication styles and service contracts
  4. 2.4 Data ownership and cross-service queries
  5. 2.5 Service discovery, configuration and runtime platform
  6. 2.6 Testing microservices
  7. 2.7 Build, deployment and versioning per service
  8. 2.8 Observability, operations and cost
  9. 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

  1. What is a monolith?

    1. An application that can only run on a mainframe
    2. An application built and deployed as one unit
    3. An application that doesn't use any database
    4. 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.

  2. What does Conway's law state?

    1. Every system eventually grows into a single large monolith
    2. Adding people to a late software project makes it even later
    3. Systems mirror the communication structure of the organization
    4. 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.

  3. What is a key drawback of synchronous HTTP chains between many services?

    1. HTTP isn't able to carry JSON payloads between services
    2. They're always faster than in-process calls, which hides bugs
    3. They make independent deployment of the services impossible
    4. 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.

  4. Why do microservices usually avoid sharing a database?

    1. Shared schemas couple services and defeat independent deployment
    2. Databases can't handle connections from more than one service
    3. Sharing a database between services is prohibited by regulation
    4. 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.

  5. What is a service mesh's role in a microservice platform?

    1. Replacing the API gateway, but only for requests from external clients
    2. Storing each service's data in a shared, replicated database
    3. Compiling each service's source code into a container image
    4. 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.

  6. Why are end-to-end tests across many services costly?

    1. They're slow, flaky and need full environments
    2. They can't be automated in any CI tool
    3. They only test one service at a time
    4. They require writing tests in Assembly

    Answer: A. They're slow, flaky and need full environments Keep them few.

  7. Why does each microservice usually get its own CI/CD pipeline?

    1. Because CI tools can't handle more than one app
    2. So it builds and deploys independently
    3. So each team must use a different CI vendor
    4. Because shared pipelines are illegal

    Answer: B. So it builds and deploys independently Independent delivery.

  8. Why do microservices need distributed tracing more than monoliths?

    1. Monolithic applications aren't able to write any logs, so tracing fills the gap
    2. Distributed tracing replaces all logging, which microservices aren't able to do
    3. One request crosses many services, so trace IDs show where it's slow or fails
    4. 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.

  9. What is a "distributed monolith"?

    1. A monolithic application that's hosted in several regions at once
    2. A monolith that serves its static assets through a CDN
    3. A single microservice that uses a message queue internally
    4. 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.

  10. What is a modular monolith?

    1. A monolith that's deployed as copies onto several servers
    2. One deployable split internally into modules with clear boundaries
    3. A set of microservices that all share a single database
    4. 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.

Practice all 261 questions

More Architecture