Q1. How is Angular architected (components, modules, services, DI)?
Short answer: Components with templates, services via DI, organized into modules or standalone components.
Strong answer: Angular apps are trees of components (template + class), with shared logic in injectable services provided through Angular’s DI. Historically organized by NgModules; modern Angular (current: Angular 22) favors standalone components and signals. Understanding DI, change detection and the component lifecycle is core.
Likely follow-up: What are standalone components and why did Angular move toward them?
What the interviewer is checking: Current Angular architecture knowledge.
Common mistake: Only knowing old NgModule-based Angular.
Q2. What are Angular signals and how do they change state management?
Short answer: Signals are reactive values that update the UI granularly without Zone.js overhead.
Strong answer: Signals (stable in recent Angular) are reactive primitives that hold a value and notify consumers on change, enabling fine-grained, efficient updates and a path toward zoneless change detection. They simplify local reactive state and computed values, complementing or replacing some RxJS use for state.
Likely follow-up: How do signals differ from RxJS observables?
What the interviewer is checking: Awareness of modern Angular reactivity.
Common mistake: Being unaware of signals in current Angular.
Q3. How does Angular change detection work?
Short answer: Angular checks components for changes; OnPush and signals limit checks for performance.
Strong answer: By default Angular checks the component tree on events/async via Zone.js. OnPush change detection only re-checks a component when its inputs change (by reference) or an event fires, cutting work. Signals enable even more granular, zoneless updates. Understanding this is key to performance.
Likely follow-up: How does OnPush reduce change-detection work?
What the interviewer is checking: Performance understanding.
Common mistake: Leaving everything on default change detection in large apps.
Q4. What is RxJS and how is it used in Angular?
Short answer: A reactive library for async streams; used for HTTP, events and state via observables.
Strong answer: RxJS models async data as observable streams you compose with operators (map, switchMap, debounceTime). Angular uses it for HttpClient, router events, forms and reactive state. Key skills: choosing the right flattening operator (switchMap vs mergeMap), and unsubscribing (async pipe or takeUntil) to avoid leaks.
Likely follow-up: switchMap vs mergeMap — when do you use each?
What the interviewer is checking: Reactive-programming competence.
Common mistake: Nested subscribes and forgetting to unsubscribe.
Q5. How do you handle forms in Angular?
Short answer: Template-driven for simple forms, reactive forms for complex, testable, dynamic forms.
Strong answer: Template-driven forms are quick for simple cases. Reactive forms build the model in code (FormGroup/FormControl), giving explicit, testable, dynamic control with synchronous access and custom validators. For anything complex or dynamic, reactive forms are preferred.
Likely follow-up: Why are reactive forms easier to unit test?
What the interviewer is checking: Practical Angular forms.
Common mistake: Forcing template-driven forms onto complex scenarios.
Q6. How do you optimize performance in an Angular app?
Short answer: OnPush, trackBy, lazy loading, signals, and avoiding heavy work in templates.
Strong answer: Use OnPush change detection and signals, trackBy in *ngFor to avoid re-rendering lists, lazy-load feature routes to shrink initial bundles, avoid function calls/heavy pipes in templates, and use pure pipes. Profile with Angular DevTools. These cut both change-detection and bundle costs.
Likely follow-up: Why does calling a function in a template hurt performance?
What the interviewer is checking: Optimization knowledge.
Common mistake: Binding to method calls that run every change-detection cycle.
Q7. How do lazy loading and routing work in Angular?
Short answer: The router loads feature routes on demand, reducing the initial bundle.
Strong answer: Angular’s router maps paths to components and can lazy-load feature areas (loadChildren/loadComponent) so their code downloads only when navigated to — shrinking the initial bundle and speeding first load. Combine with route guards for auth and preloading strategies for perceived speed.
Likely follow-up: How does lazy loading affect initial load time?
What the interviewer is checking: Routing and bundling understanding.
Common mistake: Eagerly loading the whole app in one bundle.