Vue.js Interview Questions and Answers
Vue.js interview questions — the reactivity system, components and props, computed vs methods vs watchers, lifecycle hooks, and Options vs Composition API.
19Questions
6Topics
Basic to AdvancedDifficulty
Fresher to 5+ YrsExperience
- 01 What is the difference between v-if and v-show in Vue? v-if adds or removes the element (and its component, listeners, child components) from the DOM entirely — higher…
- 02 Why do you need a key when rendering a list (v-for / ng-repeat / React)? The key gives each list item a stable identity so the framework's diffing algorithm can match old and new items and…
- 03 How do parent and child components communicate in Vue? Data flows down via props and events flow up via emit. A parent passes data to a child as props (read-only in the…
- 04 What are the Vue component lifecycle hooks? The main hooks are beforeCreate/created (state ready, no DOM), beforeMount/mounted (DOM available),…
- 05 What is the difference between the Options API and the Composition API in Vue? The Options API organises a component by option type — data, methods, computed, watch. The Composition API (Vue 3)…
- 06 What is the difference between ref and reactive in Vue 3? ref(value) wraps any value (primitive or object) in a reactive box you access via .value. reactive(obj) makes an…
- 07 When should you use a watcher in Vue instead of a computed property? Use a computed to derive a value you display. Use a watcher when a change should trigger a side effect — call an API,…
- 08 What are slots in Vue? Slots let a parent pass template content into a child component — content projection. A default slot is the child's…
- 09 What is Pinia (or Vuex), and when do you need a state store? Pinia (the current standard; Vuex was the predecessor) is a centralized store for state that many unrelated components…
- 10 What are the main differences between Vue 2 and Vue 3? Vue 3 rebuilt reactivity on ES6 Proxy (Vue 2 used Object.defineProperty, which couldn't detect added properties or…
- 11 How does routing work in a Vue single-page app? Vue Router maps URL paths to components rendered in <router-view>, without a full page reload. It supports dynamic…
- 12 What does putting :key on a component (not in v-for) do? Changing a component's :key tells Vue to destroy the old instance and create a fresh one, resetting all its internal…
- 13 What is provide/inject in Vue, and when do you use it? provide lets an ancestor component expose a value that any descendant can inject, no matter how deep — avoiding “prop…
- 14 What is the virtual DOM, and does it always make things faster? The virtual DOM is a lightweight JS representation of the UI. On a state change, the framework builds a new vDOM tree,…
- 15 How does v-model work on a custom component? v-model on a component is sugar for a modelValue prop plus an update:modelValue event. The child renders the prop and…
- 16 What is nextTick in Vue? Vue batches DOM updates — when you change reactive state, the DOM isn't updated synchronously. await nextTick() (or…
- 17 What is a composable in Vue, and how does it replace mixins? A composable is a plain function (by convention useSomething()) that uses Composition API primitives (ref, computed,…
- 18 How does Vue's reactivity system work? Vue tracks which parts of your component's render depend on which reactive properties. When a component renders, Vue…
- 19 What is the difference between computed properties, methods and watchers in Vue? A computed property is a cached derived value — it only recalculates when one of its reactive dependencies changes,…
No questions match those filters
Try removing a filter or .
About these Vue.js questions
Vue is a common choice for new frontends on .NET APIs. Interviewers ask about the reactivity system (how Vue tracks dependencies and re-renders), the difference between computed, methods and watch, one-way props with events up, lifecycle hooks, and when to reach for the Composition API.