All jobs / Frontend / web developer / Vue

Frontend / web developer interview question · 3–5 years

A Vue 3 app has one Pinia store holding everything: the logged-in user, every form’s field values, modal open flags and cached API lists.

How do you restructure state, and what rule do you give the team?

The strongest answer

Several stores split by domain. Pinia keeps state that is genuinely shared or must outlive a page; form fields and modal flags go back to local component state; changes go through actions so they are traceable

Why it works

Right — the question for every piece of state is who else needs it and for how long. Global by default makes every component depend on everything.

What a good answer covers

Answers that fall short

Who gets asked this

More Vue questions