All jobs / Backend developer / Architecture
Backend developer interview question · 5+ years
The interviewer asks: “Billing keeps importing Order's entity. What's the design problem?” Strongest answer?
The strongest answer
We've crossed a bounded context. Billing should depend on a published language — an API or event — not on Order's tables and types. I split the model and the ownership, not just the repo folders.
Why it works
Exactly. DDD here is practical: independent evolution, independent deploys, a contract at the edge. Shared entities are a distributed monolith.
What a good answer covers
- Contexts meet at contracts, not tables.
- Don't share entities across domains.
- A shared kernel is still coupling.
- No drive-by SQL into another team's DB.
Answers that fall short
- Close, but not the strongest: That's DRY; one Order class should rule them all.
DRY across domains copies the wrong thing. Duplicate a name rather than a schema if the meanings differ. - Weak: Put both in a shared kernel NuGet/JAR and version it weekly.
A weekly shared kernel is still a coupling clock. You will coordinate releases forever. - Red flag: Give billing SELECT on the orders table and call it integration.
Reading another service's tables couples you to their indexes, columns and incidents. That's the integration style we regret.
Who gets asked this
More Architecture questions
- The interviewer asks: “How do you isolate tenants in a multi-tenant backend?” Strongest answer?
- The interviewer asks: “A bad deploy took all regions with it. What architecture would have contained it?”…
- A team proposes ports and adapters for a service that reads a queue, writes to one database, and will never…
- The interviewer asks: “Two years of events, consumers you don't own. How do you evolve the schema?” Strongest…
- The interviewer asks: “Auth, TLS, and WAF — in every service or at the gateway?” Strongest answer?
- An interviewer says: “Design a URL shortener.” What do you do first?
- What does a load balancer do, and what does it not do?
- What is the difference between scaling up and scaling out?