IT
Microservices Patterns & Distributed Architectures
Test your mastery of microservices patterns, including Saga, CQRS, Outbox, API Gateways, and domain decomposition.
This is a free, 16-question multiple-choice quiz. Answer each question to see whether you got it right, with an explanation for every answer. There is no sign-up and no time limit — take it as many times as you like, and scroll down for the full answer key once you are done.
Question 1 of 16
0 correct
What problem does the Transactional Outbox pattern primarily address?
Press A–D to choose · Enter to submit
Answer key & explanations
Every question in this quiz, with the correct answer marked and an explanation of why it is right. Use it to revise before or after taking the quiz above.
1.What problem does the Transactional Outbox pattern primarily address?
- APreventing SQL injection attacks in multi-tenant schemas
- BAtomically updating the database and publishing a corresponding event to a message broker without dual-write failures✓ Correct
- CEncrypting outgoing HTTP payloads before transmitting them through an API gateway
- DCompressing database backups before moving them to cloud object storage
Correct answer: Atomically updating the database and publishing a corresponding event to a message broker without dual-write failures
The Transactional Outbox pattern writes domain updates and outgoing events into the same local database transaction; a separate poller or CDC tool then reliably publishes events to the broker.
2.How does an Orchestrated Saga differ from a Choreographed Saga in distributed transaction management?
- AOrchestrated sagas run exclusively in Kubernetes; choreographed sagas run on bare-metal servers
- BAn orchestrated saga uses a central coordinator to invoke participants; choreographed sagas rely on services reacting to events autonomously✓ Correct
- CAn orchestrated saga cannot execute compensating transactions; choreographed sagas can
- DChoreographed sagas require a shared relational database across all microservices
Correct answer: An orchestrated saga uses a central coordinator to invoke participants; choreographed sagas rely on services reacting to events autonomously
In an orchestrated saga, a central orchestrator tells services which local transactions to execute, whereas choreography relies on services publishing and subscribing to events without a central coordinator.
3.What is the primary role of a Compensating Transaction in the Saga pattern?
- ATo accelerate database writes by deferring foreign key index creation
- BTo semantically undo the effects of a previously committed local transaction when a downstream step fails✓ Correct
- CTo balance financial ledgers during annual accounting audits
- DTo convert synchronous REST calls into asynchronous gRPC payloads
Correct answer: To semantically undo the effects of a previously committed local transaction when a downstream step fails
Because sagas commit changes locally at each step, failures in later steps require executing compensating transactions that reverse earlier committed operations.
4.What does the Command Query Responsibility Segregation (CQRS) pattern advocate?
- ASplitting service codebases into separate frontend and backend repositories
- BSeparating operations that mutate state (Commands) from operations that read state (Queries), often using different models✓ Correct
- CForbidding the use of relational databases for microservice architectures
- DEnforcing that every microservice exposes both a GraphQL and a gRPC endpoint
Correct answer: Separating operations that mutate state (Commands) from operations that read state (Queries), often using different models
CQRS separates write operations (Commands) from read operations (Queries), allowing developers to scale, optimize, and model read and write data pathways independently.
5.What is the primary benefit of deploying the Backend for Frontend (BFF) pattern?
- AIt eliminates the need for frontend developers to write JavaScript code
- BIt provides tailored API gateways optimized for the unique requirements of specific client interfaces (e.g., mobile, web, IoT)✓ Correct
- CIt forces all client applications to communicate directly with internal microservice databases
- DIt automates the rendering of React components on edge servers
Correct answer: It provides tailored API gateways optimized for the unique requirements of specific client interfaces (e.g., mobile, web, IoT)
The BFF pattern creates dedicated gateway services that aggregate and tailor backend data specifically to the requirements, network profiles, and display needs of distinct frontend platforms.
6.In Domain-Driven Design (DDD), what is a Bounded Context?
- AThe physical memory boundary allocated to a Docker container by the Linux cgroups subsystem
- BA clear boundary within which a specific domain model applies and terms in the ubiquitous language have a singular meaning✓ Correct
- CA network firewall rule isolating development environments from production
- DA database transaction boundary limited to a single SQL table
Correct answer: A clear boundary within which a specific domain model applies and terms in the ubiquitous language have a singular meaning
A Bounded Context defines the conceptual and linguistic boundary within which a particular domain model is consistent and terms have unambiguous, contextual meanings.
7.What purpose does Change Data Capture (CDC) serve in event-driven microservices architectures?
- ADetecting changes in Git repositories to trigger automated CI/CD builds
- BReading committed transaction log changes from a database engine and streaming them as events to message brokers✓ Correct
- CTracking configuration changes in Kubernetes Helm charts
- DAuditing employee access permissions across internal infrastructure
Correct answer: Reading committed transaction log changes from a database engine and streaming them as events to message brokers
CDC tools (such as Debezium) monitor database transaction logs (e.g., Postgres WAL or MySQL binlog) to emit reliable, low-latency change events without impacting application code.
8.What architectural problem is introduced by the 'Distributed Monolith' antipattern?
- AMicroservices share no common network infrastructure and cannot communicate
- BServices are deployed separately but remain tightly coupled via synchronous dependencies, sharing the downsides of both paradigms✓ Correct
- CA single monolithic codebase is compiled into WebAssembly to execute in user browsers
- DA single database table is replicated across hundreds of physical hard drives
Correct answer: Services are deployed separately but remain tightly coupled via synchronous dependencies, sharing the downsides of both paradigms
A distributed monolith occurs when tightly coupled components are split into microservices, compounding operational, networking, and latency complexities while hindering independent deployment.
9.Which pattern isolates failure by allocating dedicated thread pools or connection limits to specific downstream dependencies?
- AAmbassador Pattern
- BBulkhead Pattern✓ Correct
- CStrangler Fig Pattern
- DSidecar Pattern
Correct answer: Bulkhead Pattern
Inspired by compartmentalized ship hulls, the Bulkhead pattern isolates resources (such as thread pools or memory) so that an outage in one downstream service does not consume all system resources.
10.What is the migration strategy behind the Strangler Fig pattern?
- AInstantly shutting down a legacy monolith and switching to greenfield microservices overnight
- BGradually replacing specific legacy system capabilities with microservices until the legacy system can be safely decommissioned✓ Correct
- CForcing legacy code to run inside lightweight sandboxed browser workers
- DInjecting artificial faults into production systems to test resilience
Correct answer: Gradually replacing specific legacy system capabilities with microservices until the legacy system can be safely decommissioned
The Strangler Fig pattern involves intercepting calls to a legacy system and routing them to new microservices piece-by-piece, gradually deprecating the monolith without risky big-bang rewrites.
11.Why is sharing a single database across multiple independent microservices widely considered an antipattern?
- ARelational databases cannot support more than two concurrent TCP client connections
- BIt breaks service autonomy, couples schema changes across teams, and bypasses domain access boundaries✓ Correct
- CIt prevents databases from using indexes and foreign key constraints
- DIt makes running automated unit tests impossible
Correct answer: It breaks service autonomy, couples schema changes across teams, and bypasses domain access boundaries
A shared database creates tight schema coupling, bypasses service business logic, risks cross-domain data corruption, and makes independent deployment and scaling impossible.
12.In an API Gateway pattern, what is request aggregation?
- ACombining multiple client requests into a single batch database transaction
- BQuerying multiple backend microservices on behalf of a single client request and returning a consolidated payload✓ Correct
- CAggregating log lines from multiple containers into a central Elasticsearch cluster
- DRouting all API traffic through a single physical network card
Correct answer: Querying multiple backend microservices on behalf of a single client request and returning a consolidated payload
Request aggregation allows an API gateway to fan out calls to multiple underlying microservices, aggregate the responses, and return a single, unified payload to minimize client round-trips.
13.What is the primary risk of relying on deeply nested, synchronous HTTP/REST call chains across a microservice fleet?
- AHTTP headers consume excessive disk space on the gateway server
- BCascading latency, increased failure rates, and tight operational coupling across the chain✓ Correct
- CRouters automatically convert GET requests into DELETE calls
- DNetwork switches refuse to route packets exceeding two hops
Correct answer: Cascading latency, increased failure rates, and tight operational coupling across the chain
Synchronous call chains compound network latency, multiply failure probabilities, and lead to thread starvation across upstream services if a single downstream service slows down.
14.What does consumer-driven contract testing (e.g., using Pact) achieve in microservices pipelines?
- AIt benchmarks the maximum requests-per-second a microservice can handle
- BIt verifies that API providers do not break the specific schema expectations of their consumers without running full end-to-end environments✓ Correct
- CIt checks source code for adherence to formatting and linting rules
- DIt verifies that consumer passwords meet enterprise security standards
Correct answer: It verifies that API providers do not break the specific schema expectations of their consumers without running full end-to-end environments
Consumer-driven contract testing codifies consumer expectations into contracts, allowing providers to validate their implementations in fast isolation builds without maintaining fragile end-to-end test environments.
15.What is the purpose of an Anti-Corruption Layer (ACL) in domain migration architectures?
- ATo scan database records for fraudulent credit card transactions
- BTo translate and isolate domain models between a new microservice and an old legacy system so neither pollutes the other✓ Correct
- CTo prevent unauthorized developers from modifying production Kubernetes secrets
- DTo clean up unreferenced Docker image layers from local developer workstations
Correct answer: To translate and isolate domain models between a new microservice and an old legacy system so neither pollutes the other
An Anti-Corruption Layer translates semantics between two distinct domain models (such as a clean new service and a messy legacy monolith), keeping the new design unpolluted.
16.What operational problem does Distributed Tracing (e.g., OpenTelemetry, Jaeger) solve across microservices?
- AIt automatically restarts failed Docker containers on remote hosts
- BIt tracks and visualizes the end-to-end path and timing of a single request across multiple interconnected services✓ Correct
- CIt balances network load equally across multi-region server clusters
- DIt optimizes database query indexes based on historical slow queries
Correct answer: It tracks and visualizes the end-to-end path and timing of a single request across multiple interconnected services
Distributed tracing propagates trace and span IDs across network hops, allowing operators to visualize the lifecycle of a request and quickly pinpoint latency bottlenecks across services.
More free quizzes
- ITDistributed Systems: Consensus & Fault ToleranceDeep dive into distributed systems engineering, covering consensus protocols (Raft/Paxos), the CAP theorem, and vector clocks.16 questions
- ITLLM Engineering: Fine-Tuning, Alignment & ServingTest your knowledge of transformer architectures, PEFT techniques (LoRA), RLHF, vLLM, and production deployment strategies.16 questions
- ITApplied AI: Systems, Embeddings & RAGAssess your understanding of practical machine learning architectures, embedding spaces, and Retrieval-Augmented Generation systems.16 questions