What is Angular workspace and monorepo architecture?
Why Interviewers Ask This
Interviewers ask this to evaluate whether you have the depth of knowledge needed to mentor others and lead technical decisions. The expected answer goes beyond definitions into practical implications and real-world consequences.
Answer
An Angular workspace can contain multiple projects (apps and libraries) managed together, enabling monorepo architectures. Nx monorepo with Angular: Nx is the most popular tool for Angular monorepos, extending the Angular CLI with: project-aware caching (only rebuild changed projects), dependency graph visualization, affected commands (only test/lint/build projects changed since last commit), code generators for libraries, and module boundary enforcement. Angular workspace (built-in): one workspace can have multiple apps: ng new my-workspace --create-application=false; cd my-workspace; ng generate application admin-portal; ng generate application customer-portal;. And shared libraries: ng generate library shared-ui; ng generate library auth; Libraries are importable as if npm packages via TypeScript path aliases in tsconfig.json: "@myorg/shared-ui": ["dist/shared-ui"]. Library types: feature libraries (feature code for one app), UI libraries (shared components), data-access libraries (services, state management), utility libraries (pure functions, models). Enforcing boundaries: use ESLint import rules or Nx module boundary rules to prevent cross-domain imports (admin features can't import customer features). Publishing libraries: build with ng build shared-ui → produces dist/ with compiled code; publish to npm or use Nx Release for versioned publishing. Benefits: code sharing without npm publishing, atomic commits across projects, consistent tooling, single node_modules.
Pro Tip
Back up your answer with a specific project or situation. Saying 'In my last Angular project, I used this when...' immediately makes your answer more credible and memorable.
Previous
What is Angular CDK (Component Development Kit)?
Next
What is Angular micro-frontend architecture?
More Angular Questions
View all →- Advanced What is Angular Ivy and how does it improve Angular?
- Advanced How does Angular handle server-side rendering (SSR) with Hydration?
- Advanced What is Angular's dependency injection hierarchical injector system?
- Advanced What are Angular Signals in detail and how do they compare to RxJS?
- Advanced What is Angular performance optimization techniques?