Skip to main content
InterviewHubPRO
Section Overview
Q13

Question 13 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

26%
Svelte & SvelteKit (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

Svelte 5's Signal Graph: How Push-Pull Reactivity Works Under the Hood.

senior LevelSignalsSystem DesignSvelte 5

In Simple Words: Svelte 5 implements a fine-grained Push-Pull Reactive Graph:

  1. Push Phase (Dirty Notification): When a $state() signal changes value, it pushes a notification down the dependency tree marking dependent $derived() signals and $effect() nodes as "dirty". No values are recalculated yet!
  2. Pull Phase (Lazy Evaluation): When the DOM or an effect actually reads the derived signal, it "pulls" the new value, executing calculations only once on-demand.
  3. If a derived signal computes the exact same value as before, propagation stops immediately, preventing downstream re-renders.