Skip to main content

Explain Angular Change Detection Strategies (Default vs OnPush).

Senior Angular
Quick Answer Default CD: checks every component on every cycle - simple but potentially slow for large trees. OnPush CD: component is only checked when inputs change (by reference), an event fires from within, async pipe emits, or markForCheck()/detectChanges() is called. OnPush with immutable data patterns dramatically reduces unnecessary DOM checks. Use Angular DevTools to visualize CD cycles.

Answer

Default Strategy: Angular runs change detection for the entire component tree whenever any async event occurs. Simple but expensive for large apps.

OnPush Strategy: Angular checks the component only when its input reference changes, an observable emits, or an event originates from the component. This dramatically improves performance.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice