DDD
Domain-Driven Design is an approach to building software around the rules and concepts of the work it supports. Developers and domain experts agree on what those concepts mean and use the same language in conversations, code, and tests.
Also known as: Domain-Driven Design, предметно-ориентированное проектирование
Start with the business rule
Domain-Driven Design (DDD) starts with questions that a database schema cannot answer. Take a hotel booking system: does holding a room guarantee a stay, and when does that hold expire? Developers work with people who know how reservations operate and turn their answers into a model that expresses the relevant rules. If the team distinguishes a hold from a confirmed reservation, that distinction should show up in discussions, code, and tests. DDD calls this shared vocabulary the ubiquitous language.
Give each model a clear boundary
Strategic DDD asks where a model applies. A bounded context is the boundary within which a model and its language have consistent meanings. In Reservations, a room is something that can be allocated for a range of dates. In Housekeeping, it's a physical space that needs to be cleaned and inspected. Forcing both teams to use one Room model ties unrelated rules together. Instead, each context keeps the concepts it needs and defines how to exchange or translate information at the boundary. A context map makes those relationships explicit.
A subdomain describes part of the business problem, such as managing room inventory. A bounded context describes the scope of a model in the solution. It's not necessarily a deployment boundary: a modular monolith can contain several bounded contexts.
Put the rule where it can be enforced
Tactical DDD offers patterns for implementing a model. An entity is identified across changes: a reservation is still the same reservation after the guest updates their contact details. A value object is defined by its values: two date ranges with the same start and end dates are equivalent. An aggregate groups model objects behind a root that controls changes and protects the business rules that must hold within that boundary.
For example, suppose a room hold can be confirmed only before it expires. An application handler loads the reservation, calls reservation.confirm(now), and saves the result. The reservation root checks the expiry and rejects the transition when the hold is no longer valid. Putting that check in the model means that a customer-facing endpoint and a staff tool can use the same rule rather than maintain separate copies. It does not mean the reservation aggregate should also contain guest profiles or housekeeping tasks.
When it pays off and how interviews test it
DDD is useful when business rules are subtle, change frequently, or differ across teams. A simple create, read, update, and delete workflow may not justify an elaborate domain model. DDD doesn't require microservices, CQRS, or event sourcing, and naming folders domain and infrastructure doesn't make the model reflect the business.
In an interview, expect a scenario rather than just a vocabulary quiz. If asked where to draw an aggregate boundary, name the rule that must hold immediately after a change and explain which data you need to enforce it. Then identify what can live outside that boundary and catch up later.