WalzoneInterview Prep
📞 Interviewing soon? Practice with a realistic AI mock phone interview — it calls you, then scores you. First 15 min FREE →

Core Java · Guru · question 96 of 100

What is a hexagonal architecture in Java? How is it used in building software systems?

📕 Buy this interview preparation book: 100 Core Java questions & answers — PDF + EPUB for $5

Hexagonal architecture is a software design pattern that is used to build flexible, maintainable, and scalable applications in Java. Also known as ports-and-adapters architecture, this pattern helps to keep the core of the application independent of the external technologies used, such as the database, user interface, or web services.

In a hexagonal architecture, the core of the application is surrounded by multiple layers, each with a specific responsibility. The innermost layer is the domain layer, which contains the business logic of the application. This layer is independent of any external technologies and can be tested and developed in isolation.

The next layer is the application layer, which provides an interface between the domain layer and the external world. It handles input/output operations and communicates with the domain layer to perform business logic.

The external interfaces, such as the database or the user interface, are handled by the adapter layer. The adapters translate the external interfaces into a format that the application layer can understand and use. The adapters also translate the output of the application layer into a format that the external interfaces can understand.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Core Java interview — then scores it.
📞 Practice Core Java — free 15 min
📕 Buy this interview preparation book: 100 Core Java questions & answers — PDF + EPUB for $5

All 100 Core Java questions · All topics