Architectural Patterns and Anti-Patterns Questions

Architecture-level patterns and the anti-patterns that signal a wrong turn. Patterns: layered and n-tier architecture, including where cross-cutting concerns like authentication, rate-limiting and tracing belong, dependency injection trade-offs, and thin-versus-fat controller design; hexagonal (ports and adapters) and clean architecture; CQRS and event sourcing; backend-for-frontend; plugin (microkernel) extension models; and the coupling, cohesion, encapsulation and separation-of-concerns principles behind them, including when each applies and what it costs. Anti-patterns: distributed monolith, chatty services, shared-database coupling, cyclic service dependencies, leaky abstractions that expose internal schemas, and golden-hammer pattern adoption. Covers the detection signals (deploy coupling, call-graph fan-out, change amplification, trace evidence), incremental remediation, and architecture governance that keeps smells from recurring. This is about diagnosing and fixing the smell in an existing design, not the monolith-versus-microservices decision itself.

MediumTechnical
97 practiced

Design patterns can become anti-patterns when they're reached for out of habit rather than fit. Describe a realistic case where adopting a popular pattern (at the service or architecture level) created more complexity or risk than it solved. What made it the wrong fit for that context, and what would have signaled the mismatch earlier?

MediumTechnical
139 practiced

Explain dependency injection (DI) and the differences between constructor injection, setter injection, and the service-locator approach. When designing a layered backend, what are the advantages and the potential pitfalls of leaning on a DI framework in your service and repository layers?

HardTechnical
73 practiced

A mature system has become 'chatty', with many synchronous service calls driving up latency. Propose a refactor plan to reduce the chattiness: the steps you'd take, how you'd stay backward-compatible along the way, the trade-offs of moving some calls to an event-driven or batched approach, how you'd preserve data correctness, and what KPIs would show it's working.

MediumTechnical
81 practiced

In a layered backend, concerns like authentication, rate-limiting, and tracing apply to nearly every request. If each service implements them independently you get drift and duplicated bugs. Where architecturally should this kind of cross-cutting logic live, what are the trade-offs of the placement options, and how do you keep the behavior consistent as new services are added?

MediumTechnical
83 practiced

Explain the Backend-for-Frontend (BFF) pattern: how it tailors APIs per client type (mobile vs. web), reduces over-fetching, and hides internal service complexity. What deployment, testing, and team-ownership trade-offs would you weigh before adopting BFFs?

Unlock Full Question Bank

Get access to all 16 Architectural Patterns and Anti-Patterns interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.