Question presented to candidate: "Three teams want to ship parts of our Angular 22 portal independently: a shell, an orders area and a reporting area. How would you structure that as micro-frontends with Module Federation, and what are the trade-offs?"
What a strong answer should cover:
- Host (shell) and remotes: each remote is built and deployed separately and exposes modules (a component or a routes file); the host loads them at runtime.
- Two implementations for Angular: webpack Module Federation (
@angular-architects/module-federation, needs a webpack builder) and Native Federation (@angular-architects/native-federation, built on the CLI's esbuild builder, ES modules and import maps). - Shared dependencies: Angular, RxJS and shared libraries configured as singletons with version rules, so one copy of
@angular/coreruns. - Dynamic remotes via a manifest (
federation.manifest.json) so URLs can change per environment without rebuilding the shell; load withloadRemoteModuleinsideloadComponent/loadChildren. - Cross-cutting concerns: routing ownership, communication (URL, custom events, a shared library), design system, auth, and failure handling when a remote is down.
- Honest trade-offs: team autonomy and independent deploys vs bundle duplication risk, version coordination, and operational complexity; a monorepo with lazy routes is often enough.
Clarifying questions expected:
- "Do teams need independent deployments, or just independent code ownership?"
- "Must all parts stay on the same Angular version, or mix versions and frameworks?"
- "Is SSR required?"
Code / implementation expected: Optional β a remote's federation config and a host route that loads an exposed component.