OnPush reduces unnecessary checking but does not mean a component updates only once. Input changes, events and relevant reactive notifications can make it eligible for checking.
Before you start
You should understand a component’s class, template and dependencies. Follow both the framework lifecycle and the ownership of each value or resource. Apply examples inside an Angular application; the surrounding application configuration and imports depend on the feature being demonstrated.
The practical goal is to reason through this situation: Replacing an input object makes a new value visible to a child; mutating the same object can obscure the change. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Trace the input
A parent and child may share one object. Changing a field does not necessarily supply a new input reference.
Step 2: Replace the value
Create a new object for the edited input. This clearly communicates a changed value across the component boundary.
Step 3: Inspect other notifications
Events and relevant reactive changes also affect checking. OnPush is not a promise that components update only once.
Worked scenario
Replacing an input object makes a new value visible to a child; mutating the same object can obscure the change.
For a user input, replace user with { ...user, name: 'Ada' } instead of modifying user.name in place. Then inspect the child display. If it is still stale, verify the actual binding and reactive notification path rather than adding arbitrary manual checks across the tree.
Common mistake
Assuming every mutation automatically triggers the correct subtree produces stale interfaces.
Verify the behavior
Test replacement and mutation separately, including updates originating outside the child. Verify the changed field reaches the template.
Interview exercise
Fix a stale child display.
Answer and reasoning
Use immutable input updates or an appropriate reactive notification, then inspect whether the component is being checked.
Continue learning
Compare the scenario with the Angular interview questions and test your understanding with the Angular MCQs. For terminology and implementation details, consult the reference material.