All jobs / Frontend / web developer / Vue
Frontend / web developer interview question · 5+ years
A five-year-old Vue codebase is on Vue 3 but written entirely in the Options API with mixins and Vuex. Some engineers want a full rewrite to the Composition API and Pinia.
What is your call?
The strongest answer
No rewrite. Both APIs are supported, so new code uses Composition API; mixins become composables when their components are touched; Vuex moves to Pinia module by module; effort goes where change is frequent
Why it works
Exactly — the Options API is not deprecated, so the migration is a choice, not an emergency. Spend it where mixins hurt and the code changes often.
What a good answer covers
- Migrate by value, not by fashion.
- New code: Composition API and Pinia.
- Mixins to composables when touched.
- Separate refactor pull requests from features.
Answers that fall short
- Close, but not the strongest: Convert everything to the Composition API in a dedicated quarter so the codebase is consistent again
A quarter of pure conversion ships nothing and risks regressions in code that was stable and rarely touched. - Weak: Forbid the Composition API so the codebase stays in one style
Freezing the style keeps mixins’ name clashes and hidden dependencies and makes hiring and library adoption harder over time. - Red flag: Let each engineer convert files as they please inside unrelated feature pull requests
Refactors hidden inside feature work are unreviewable and make every regression hard to trace.
Who gets asked this
More Vue questions
- A child component receives a quantity prop and has plus and minus buttons. In Vue, how should the child…
- In a Vue 3 component using script setup, you try to focus an input through a template ref at the top of setup…
- In setup, a developer writes const { count } = state, where state is a reactive object. The template shows…
- In Vue, when do you use a computed property and when a watcher?
- A user page loads its data in onMounted. Clicking from /users/1 to /users/2 changes the URL, but the page…
- What is wrong with the composable, and what is the contract a composable should follow?
- How do you restructure state, and what rule do you give the team?