foundation

General principles

Classify state by owner, lifetime, source of truth, derivation, shape, and mutation boundary.

Principles interviews judge whether you classify state before picking a library. Answers should connect owner, lifetime, source of truth, derivation, shape, and mutation boundary.

Subtopics: local vs global state, server vs client state, derived state, normalization, and immutability.

On interviews: walk through a feature and label each piece of state — who writes it, who reads it, and whether it can be recomputed.

Common pitfalls: treating all remote JSON as client state, storing counts that should be derived, and normalizing before you have duplication pain.

Checklist:

  • Classify by owner and lifetime.
  • Separate canonical from derived.
  • Normalize entity graphs when shared.
  • Keep updates explicit and traceable.