Junior From PDF Angular Angular

What is the difference between default and onPush change detection strategies in Angular?

Short answer: Change Detection Strategy Description When to Use Default Angular checks every component in the component tree every cycle Simple apps or components with frequent changes OnPush Angular checks component only if input references change or events Optimizes performance, suitable for immutable data & smart components How to set OnPush: @Component({ selector: 'app-example', changeDetection:…

Explain a bit more

ChangeDetectionStrategy.OnPush, template: `...` }) export class ExampleComponent {} Key Difference: Default: Runs change detection every time. OnPush: Runs only when inputs change by reference or manual trigger.

Real-world example (ShopNest)

A shared CartService is injected into header and product pages so both see the same cart count.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details