Build fluency in the vocabulary of isolating core business logic behind ports with adapters plugged in from outside.
0 / 5 completed
1 / 5
At standup, a dev mentions defining an application's core business logic against abstract ports it owns, then plugging in concrete adapters, such as a specific database driver or REST controller, from the outside, so swapping infrastructure never requires touching the core logic. What is this architectural style called?
Hexagonal architecture, also called ports and adapters, is exactly this: it isolates core business logic behind ports, which are interfaces the core defines, and lets concrete adapters for specific infrastructure, like a database driver or REST controller, be plugged in from the outside without the core ever depending on them directly. A hash collision is an unrelated hash-table concept about two keys sharing a bucket. This isolate-the-core-behind-ports approach is exactly why hexagonal architecture lets infrastructure be swapped or mocked without ever touching business logic.
2 / 5
During a design review, the team adopts hexagonal architecture for a payment-processing core, specifically because swapping the production payment gateway adapter for a test adapter never requires changing the core business logic. Which capability does this provide?
Hexagonal architecture here provides infrastructure-independent core logic, since the core only depends on ports it defines, letting any adapter, such as a test payment gateway, be swapped in from outside without changing the core logic at all. A core module that imports a concrete payment gateway SDK directly ties every future gateway change to editing the core itself. This depend-only-on-ports behavior is exactly why hexagonal architecture is favored for logic that must stay stable while surrounding infrastructure changes.
3 / 5
In a code review, a dev notices a payment-processing core module imports a specific payment gateway SDK's classes directly throughout its business logic, instead of depending on a port that any gateway adapter could implement. What does this represent?
This is a missed hexagonal-architecture opportunity, since depending on a port instead of the SDK directly would let any gateway adapter be swapped in without touching the core business logic. A cache eviction policy is an unrelated concept about discarded cache entries. This direct-SDK-import pattern is exactly the kind of coupling a reviewer flags once the core logic is expected to outlive any single infrastructure choice.
4 / 5
An incident report shows switching payment providers required rewriting logic scattered across dozens of files throughout the core business logic, because the core imported the old gateway's SDK directly instead of depending on a port with a swappable adapter. What practice would prevent this?
Adopting hexagonal architecture lets a new gateway be added by writing a new adapter, without touching the core logic at all. Continuing to import the payment gateway SDK directly throughout the core business logic regardless of how many files a future provider switch touches is exactly what caused the scattered rewrite described in this incident. This ports-and-adapters approach is the standard fix once core logic is confirmed to need independence from any single infrastructure choice.
5 / 5
During a PR review, a teammate asks why the team reaches for hexagonal architecture instead of a traditional layered architecture where the core depends directly on infrastructure classes, given that the layered approach is simpler to set up. What is the reasoning?
Hexagonal architecture trades a small amount of upfront indirection, defining ports and adapters, for a core that stays fully testable and swappable regardless of infrastructure changes, while a layered architecture with direct infrastructure dependencies is quicker to start but couples core logic to specific implementations, making later swaps and isolated testing harder. This is exactly why hexagonal architecture is favored for core logic expected to outlive its surrounding infrastructure, while simpler layered coupling remains acceptable for short-lived or infrastructure-stable code.
What does the "Hexagonal Architecture Vocabulary" vocabulary exercise cover?
This exercise tests real IT vocabulary related to hexagonal architecture vocabulary through 5 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 5 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — this module shares real-world context with 11 other vocabulary modules. See "Related vocabulary" below to keep building a connected skill set.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.