Signals Questions with Answers

5 practice questions on Signals (Angular) with answers and step-by-step solutions. Try 5 samples below, then practise all 5 free in the AptiNest app.

Sample questions

Question 1Easy

Which function creates a writable signal?

  1. observable()
  2. state()
  3. ref()
  4. signal()

Answer: D. signal()

Explanation

const count = signal(0).

Step-by-step solution

  1. Angular API.

Why the other options are wrong

  • A. observable() is not an Angular function that creates signals.
  • B. state() is not an Angular function for writable signals.
  • C. ref is Vue's API, not Angular's way to create a signal.

Question 2Medium

Which method sets a new value on a writable signal?

  1. count = 5
  2. count.push(5)
  3. count.next(5)
  4. count.set(5)

Answer: D. count.set(5)

Explanation

set replaces the value; update derives from the previous.

Step-by-step solution

  1. Use API.

Why the other options are wrong

  • A. Assigning to the variable replaces the signal, not its value.
  • B. Signals have no push method; push belongs to arrays.
  • C. next belongs to observables and subjects, not to signals.

Question 3Medium

What does computed() create?

  1. A writable signal that components can change with set() at any time they like
  2. A read-only signal derived from other signals that updates automatically
  3. An observable that performs an HTTP call
  4. A route guard for navigation

Answer: B. A read-only signal derived from other signals that updates automatically

Explanation

computed is lazily evaluated and memoised.

Step-by-step solution

  1. Derived state.

Why the other options are wrong

  • A. computed creates read-only signals; signal creates writable ones.
  • C. computed derives a value from signals; it makes no HTTP calls.
  • D. computed is not a route guard; it derives signal values.

Question 4Medium

How do you read the value of a signal named count in code?

  1. count()
  2. count.value
  3. count.get
  4. count[0]

Answer: A. count()

Explanation

Signals are getter functions.

Step-by-step solution

  1. Call it.

Why the other options are wrong

  • B. Signals are read by calling them, not through a value property.
  • C. Signals have no get method; call the signal as a function.
  • D. Indexing a signal does nothing; call it with parentheses.

Question 5Hard

What does effect() do?

  1. Runs a side-effect function whenever the signals it reads change
  2. Creates a pure pipe from a plain function that formats values in templates
  3. Replaces ngOnInit as the init hook
  4. Waits for HTTP calls to complete

Answer: A. Runs a side-effect function whenever the signals it reads change

Explanation

Effects track the signals read inside them.

Step-by-step solution

  1. Tracks reads.

Why the other options are wrong

  • B. effect does not create pipes; pipes are declared with @Pipe.
  • C. effect does not replace ngOnInit as an initialisation hook.
  • D. effect reacts to signal changes, not to HTTP calls finishing.

Practise all 5 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Angular topics · All topics