Angular Interview Questions Rxjs Change Detection 2025 Interview Questions & Answers
40 questions available
Mid
Answer
Signals:
Pull-based change reactivity
Fine-grained updates
No global dirty checks
Zone.js:
Monkey patches events
Triggers global change detection
Signals avoid unnecessary component tree checks.
Mid
Answer
Angular 17+ uses non-destructive hydration:
Browser reuses server-generated DOM
Angular attaches event listeners without re-rendering
Improves first interaction time.
Mid
Answer
Lazy Loading:
Load modules on route activation
Deferred Loading (Angular 17):
Automatic component loading based on:
viewport visibility
network conditions
browser idle time
Mid
Answer
No global change detection cycles
No overhead from monkey-patching events
Signals or manual change detection govern updates.
Mid
Answer
Standalone components:
Declare their own imports
Can be bootstrapped directly
Simplify architecture
Enable tree-shaking of unused dependencies.
Mid
Answer
Angular performs:
Unidirectional data flow checks
Runs update functions for each binding
Compares previous & current values
Re-renders affected DOM parts
Under OnPush, only checks:
Input changes
Events
Observable emissions
Mid
Answer
Angular compares references, not values.
Mutating objects silently ? no change detection.
Mid
Answer
Used to:
Clean up resources on component destruction
Auto-unsubscribe
Replace ngOnDestroy
Works well with Signals and RxJS.
Mid
Answer
Happens when:
Providers are created outside component lifecycle
No module boundary to destroy them
Standalone architecture reduces such leaks.
Mid
Answer
Signal Effects:
Auto-track dependencies
Trigger on input mutation
NgRx Effects:
Reactive side-effects for global state
Powered by RxJS streams
Complementary, not replacements.
Mid
Answer
Angular hydrates:
Only interactive components
Leaves static ones untouched
Better for CMS/marketing websites.
Mid
Answer
Router can:
Cache component instances
Restore state instantly
Avoid re-render and re-fetch
Useful for tab-based UIs.
Mid
Answer
Functions run:
On every change detection cycle
Causes:
Performance degradation
DOM thrashing
Mid
Answer
Signals store:
Cached computed values
Update only when dependent signals change.
Mid
Answer
Because it:
Auto-unsubscribes
Integrates with change detection
Avoids memory leaks
Uses smart scheduling
Mid
Answer
Benefits:
Easier testing
Lazy service creation
Tree-shakable providers
Better DI in functional components
Mid
Answer
Angular CLI outputs:
defer for main bundle
Preloads critical assets
Optimizes render path
Mid
Answer
root: Singleton
platform: Shared across multiple Angular apps
any: New instance per lazy module
Mid
Answer
Ivy converts templates to:
Instruction sets (??elementStart, ??bind)
Executed directly for DOM creation
Highly optimized and tree-shakable
Mid
Answer
Without trackBy:
Angular destroys & re-creates entire DOM list
With trackBy:
Only changed items are re-rendered
Mid
Answer
They mark:
Event boundaries
Dynamic zones for re-hydration
Pre-existing DOM elements to reuse
Mid
Answer
Angular configures:
Eager preload
Network-aware preload
Idle-time preload
Improves routing speed.
Mid
Answer
Because:
Ivy compiles everything on demand
Component factories auto-generated
Mid
Answer
Occurs when:
Template refers to unknown element/attribute
Solutions:
Import correct standalone component
Add CUSTOM_ELEMENTS_SCHEMA
Mid
Answer
Writable:
const count = signal(0);
count.set(1)
Computed:
const total = computed(() => count() * 2);
Mid
Answer
Because:
Multi-slot projections require DOM rearranging
Change detection runs across projected nodes
Mid
Answer
Each lazy route gets:
Its own injector tree
Scoped service instances
Isolated dependency contexts
Mid
Answer
Occurs when:
Server-rendered DOM ? Client-rendered DOM
Angular logs hydration errors and re-renders component.
Mid
Answer
Defer JS
Preload above-the-fold components
Image optimization
Remove blocking imports
Mid
Answer
Because:
No event monkey-patching
No global digests
Only Signal-triggered updates
Better FPS on complex UI
Mid
Answer
Cold:
Unicast
New data for every subscription
Example: of(), from()
Hot:
Multicast
Data shared
Example: Subject, DOM events
Warm:
Hot but delayed subscription
Example: shareReplay caching
Mid
Answer
Because:
Cancels previous inner stream
Useful for autocomplete
But for critical actions ? may drop requests.
Mid
Answer
Because it does NOT cancel prior requests.
Can hammer backend.
Mid
Answer
auditTime emits latest value after silence window.
throttleTime emits first value and ignores rest.
Mid
Answer
Otherwise stream completes permanently ? no further emissions.
Mid
Answer
Subject:
No replay
Emits new values only
ReplaySubject:
Stores buffer of last N values
Replays to new subscribers
Mid
Answer
Prevents:
Memory leaks
Endless subscriptions
Cold source repeated execution.
Mid
Answer
ConcatMap:
Executes tasks sequentially
ExhaustMap:
Ignores new emissions until inner observable completes
Great for "Login" button spam.
Mid
Answer
takeUntil only stops emissions if:
destroy$ emits AND completes
If destroy$ doesn't complete ? subscribers linger.
Mid
Answer
Schedulers control:
Execution context
Queue type
Async timing
Examples:
asyncScheduler ? non-blocking
queueScheduler ? sync batch
animationFrameScheduler ? UI smooth animations