Angular Interview Questions on Signals and Derived Values
A writable signal owns a value; a computed signal derives a value from other signals. In Angular interview questions, start by deciding what the user can change directly and what the application can calculate.
By Ravindra Wadile · Published

577 words · About 3 min read
A writable signal owns a value; a computed signal derives a value from other signals. In Angular interview questions, start by deciding what the user can change directly and what the application can calculate.
A quantity is editable. A line total can be calculated from that quantity and a unit price. Storing both independently creates a chance that they disagree. This example uses whole cents to keep the arithmetic clear; it is not a complete money or tax implementation.
How do you express the dependency?
import { computed, signal } from '@angular/core';
const quantity = signal(2);
const unitPriceCents = signal(350);
const totalCents = computed(() => quantity() * unitPriceCents());
if (totalCents() !== 700) throw new Error('Initial total');
quantity.update(value => value + 1);
if (totalCents() !== 1050) throw new Error('Updated total');
unitPriceCents.set(400);
if (totalCents() !== 1200) throw new Error('Updated price');
Calling a signal reads its value. Set replaces a writable signal's value, while update calculates the next value from the current one. Total has no independent setter because its meaning comes from the inputs.
When does computed run?
A computed value is evaluated lazily and cached. Reading it makes the value available; changing a tracked dependency invalidates the previous result. This does not mean a computed callback is the right place for a request or another side effect.
Keep the derivation pure. It should describe a value, not send email, write storage or alter another signal. That makes the answer easier to test and avoids a hidden chain of state updates.
Are dependencies always fixed?
Dependencies reflect the signals actually read during a derivation. If a branch does not read a particular signal, that signal is not a dependency for that execution. This can be useful, but a complicated branching derivation can become hard to reason about.
Practice by adding a showTotal signal and returning a placeholder when it is false. Explain which signals are read in each branch before predicting when the calculation needs to be refreshed.
Does readonly prevent deep mutation?
No. A readonly signal removes the writable signal interface from that reference. It does not recursively freeze an object or array stored inside it. Mutating an array in place can also hide the intended change from equality-based update behavior.
Prefer returning a new collection for an actual collection change. Also keep mutation rights inside the state owner instead of handing every child an editable object. A TypeScript annotation alone is not a runtime security boundary.
When is an effect useful?
An effect can connect reactive state with an external concern where that is appropriate for the chosen Angular API and context. It is not necessary just to keep total synchronized with quantity. Use computed for that derivation.
Understand effect scheduling and cleanup before depending on timing. Do not make an interview answer rely on a claim that an effect always runs immediately like an ordinary function call.
What checks should you practice?
- Change quantity and unit price independently.
- Check that reading total never changes its inputs.
- Reject invalid quantities at the input or domain boundary.
- Test conditional derivations with both branches.
- Separate a pure signal calculation test from a component rendering test.
A concise answer identifies the writable owner, the derived value and the boundary for side effects. Then use the small arithmetic trace to show that you understand the dependency.
References and next practice
angular question collection · Browse interview topics · Practise a question in Interview Challenge · How to Answer Technical Interview Questions Out Loud