Angular Web Framework Angular Industry Standards 3 — Questions and Answers
Question 1: What is the recommended state management approach for large-scale Angular enterprise applications?
- Store all state in components
- Use NgRx or similar Redux-pattern library (Correct answer)
- Use localStorage for all state
- Rely solely on Angular services with BehaviorSubject
Correct answer: Use NgRx or similar Redux-pattern library
NgRx provides a predictable, unidirectional data flow with DevTools support, making it the industry standard for large Angular apps.
Question 2: According to Angular industry standards, when should you use OnPush change detection strategy?
- Only for root components
- For performance-sensitive components with immutable inputs or observable-driven data (Correct answer)
- Never — default is always better
- Only for components without templates
Correct answer: For performance-sensitive components with immutable inputs or observable-driven data
OnPush reduces the number of change detection cycles by only running when inputs change reference or an observed event fires.
Question 3: What Angular feature is considered the modern industry standard for lazy loading feature modules?
- ViewChild lazy directive
- loadChildren with dynamic import() in route definitions (Correct answer)
- NgModule.forRoot() split
- RouterLink with deferred attribute
Correct answer: loadChildren with dynamic import() in route definitions
Using dynamic import() in loadChildren tells the Angular router and bundler to create a separate chunk loaded on demand.
Question 4: Which accessibility (a11y) practice is mandated by US federal standards for Angular web apps?
- Adding tooltips to all elements
- WCAG 2.1 Level AA compliance (Correct answer)
- Using only native HTML elements
- Disabling keyboard navigation
Correct answer: WCAG 2.1 Level AA compliance
US federal agencies must meet WCAG 2.1 Level AA under Section 508, and industry best practice applies the same standard broadly.
Question 5: What is the recommended pattern for unsubscribing from RxJS observables in Angular components?
- Let subscriptions leak — Angular handles cleanup
- Use takeUntilDestroyed() or async pipe to manage subscriptions (Correct answer)
- Call unsubscribe() in ngOnInit
- Use setTimeout for cleanup
Correct answer: Use takeUntilDestroyed() or async pipe to manage subscriptions
takeUntilDestroyed() (Angular 16+) or the async pipe are the modern standards for preventing memory leaks from observable subscriptions.
Question 6: In an Angular monorepo, what tool has become the industry standard for managing multiple projects?
- Lerna alone
- Nx (formerly Nrwl) (Correct answer)
- Angular CLI workspaces with no extras
- npm workspaces only
Correct answer: Nx (formerly Nrwl)
Nx provides advanced caching, affected-project detection, code generators, and dependency graph visualization tailored for Angular monorepos.
Question 7: What is the Angular community standard for organizing shared code across multiple feature modules?
- Duplicate code in each module
- Create a SharedModule or shared library (in Nx) imported by feature modules (Correct answer)
- Put everything in AppModule
- Use global variables
Correct answer: Create a SharedModule or shared library (in Nx) imported by feature modules
A SharedModule (or shared Nx library) consolidates reusable components, pipes, and directives to avoid duplication across feature modules.
What is the recommended state management approach for large-scale Angular enterprise applications?