← All topics

Design Patterns Senior interview questions and answers

75 questions for a Design Patterns (Senior) interview - with correct answers, explanations and links to the docs.

Take this quiz
  1. 1.How does the "signals" model (Solid, Preact Signals, Angular Signals) differ from React's model?
  2. 2.What's the main trade-off of micro-frontends?
  3. 3.Why is React declared as a shared singleton in Module Federation?
  4. 4.How does the Strangler Fig pattern work when migrating a legacy frontend?
  5. 5.What does CQRS mean?
  6. 6.What is Event Sourcing?
  7. 7.What is a Bounded Context in DDD?
  8. 8.What's the idea of hexagonal architecture (Ports & Adapters)?
  9. 9.When does Clean Architecture on the frontend become harmful?
  10. 10.How do you automatically enforce architectural import rules (e.g. FSD layers)?
  11. 11.What is an Anti-Corruption Layer?
  12. 12.How does an RxJS Observable differ from a Promise?
  13. 13.What do statecharts (XState) offer compared to a flat finite state machine?
  14. 14.What is the Backend for Frontend (BFF) pattern?
  15. 15.What is the expression problem, and how does it show up in TS?
  16. 16.What does "functional core, imperative shell" mean?
  17. 17.What is the "Hollywood principle", and how does it show up in React?
  18. 18.What is a Composition Root?
  19. 19.Why is Service Locator often considered an anti-pattern compared to DI?
  20. 20.What's wrong with a "God Context" - one React Context holding all of the app's state?
  21. 21.What is temporal coupling?
  22. 22.What does Conway's law state?
  23. 23.How does the MobX approach differ from Redux architecturally?
  24. 24.Why is separating "server" and "client" state considered an important architectural decision?
  25. 25.What is Islands Architecture?
  26. 26.What's the right way to evolve the public API of a shared component library?
  27. 27.What is an ADR (Architecture Decision Record)?
  28. 28.Why is the order of middleware or interceptors in a chain of responsibility risky?
  29. 29.What distinguishes a Value Object?
  30. 30.What is an Aggregate in DDD?
  31. 31.What does the Command-Query Separation (CQS) principle require?
  32. 32.What does the "Tell, Don't Ask" principle mean?
  33. 33.What does the Fail Fast principle mean?
  34. 34.What's the risk of Postel's law ("be liberal in what you accept")?
  35. 35.How should the UI account for eventual consistency in an event-driven system?
  36. 36.How does redux-saga differ from listener middleware and thunks?
  37. 37.Why is normalizing data in a frontend store an architectural pattern rather than a micro-optimization?
  38. 38.How do you use Strategy for A/B tests without cluttering components with conditions?
  39. 39.What are afferent and efferent coupling of a module?
  40. 40.How does a modular monolith differ from microservices (micro-frontends)?
  41. 41.What are domain events on the frontend, and why are they useful?
  42. 42.How does the Circuit Breaker pattern help the client when an API fails?
  43. 43.When is the Visitor pattern justified in a TypeScript project?
  44. 44.How do you implement reliable undo in a collaborative editor with several users editing?
  45. 45.What does a Facade over a third-party UI library (e.g. your own <Button> on top of MUI) give you?
  46. 46.What's the difference between "implementation inheritance" and "interface inheritance"?
  47. 47.Why is the Saga pattern (orchestration) in distributed processes relevant to the frontend?
  48. 48.How do Server Components change architecture compared to an SPA?
  49. 49.What is an "internal platform" (design system + shared packages), and when should you extract one?
  50. 50.What is the "second-system effect" in architectural decisions?
  51. 51.What problem does the Transactional Outbox pattern solve?
  52. 52.How does an API Gateway differ from a Backend for Frontend?
  53. 53.What is the core idea of the actor model?
  54. 54.Why distinguish release, experiment, ops and permission toggles?
  55. 55.How does an "event notification" differ from "event-carried state transfer"?
  56. 56.What characterizes a microkernel (plugin) architecture, as in VS Code?
  57. 57.What does "parse, don't validate" mean?
  58. 58.Two packages: checkout needs to send emails, and notifications implements email sending. Following DIP, who owns the interface?
  59. 59.What does the Stable Dependencies Principle say?
  60. 60.Why does the Acyclic Dependencies Principle matter in a monorepo?
  61. 61.What is connascence?
  62. 62.What does the Law of Leaky Abstractions say?
  63. 63.What does Hyrum's Law imply for a widely used component library?
  64. 64.How does Chesterton's fence apply to refactoring legacy code?
  65. 65.What is the Bulkhead pattern?
  66. 66.How does the Cache-Aside pattern work?
  67. 67.What is a retry storm, and how is it prevented?
  68. 68.What do consumer-driven contract tests (e.g. Pact) give a frontend and backend?
  69. 69.What is an architectural fitness function?
  70. 70.How does trunk-based development relate to feature flags?
  71. 71.What is a key trade-off of a monorepo compared to many repositories?
  72. 72.How does saga orchestration differ from choreography?
  73. 73.What is a "distributed monolith"?
  74. 74.Why are Value Objects useful for money amounts on the frontend?
  75. 75.Why use queues to decouple a slow operation (e.g. generating a PDF report) from a user request?