AI
prepair.app
Start interview →
EnglishРусскийУкраїнська
💚

Senior Vue FrontendVue interview questions

Senior · 5+ years of experience

Vue interviews focus on the reactivity system, the Composition API, and component communication. Below are the most common questions with model answers. Senior: architecture, trade-offs, mentoring, and decision-making.

Topics to prepare

Reactivity: ref and reactive
Composition API vs Options API
Component lifecycle
Pinia / Vuex
Slots and props
Vue Router

6 Senior-level questions with answers

1

Explain the difference between computed and watch.

Answer

computed derives a value from other reactive state, caches it, and recomputes only when a dependency changes — use it whenever the result is a value you render. watch runs a side effect in response to a change: fetching data, writing to storage, triggering an animation. If you find yourself assigning to a variable inside a watcher, a computed is almost always the better answer.

2

Name the lifecycle hooks in Vue 3.

Answer

In the Composition API they are onBeforeMount and onMounted, onBeforeUpdate and onUpdated, onBeforeUnmount and onUnmounted, plus onErrorCaptured, onActivated and onDeactivated for cached components. setup() itself replaces beforeCreate and created. onMounted is where DOM access and subscriptions belong, and onUnmounted is where you must tear them down.

3

What are slots? Give an example of a scoped slot.

Answer

A slot is a placeholder in a child template that the parent fills with its own markup, which makes wrapper components reusable. A scoped slot additionally passes data back up from the child to the slot content — for example a list component that handles fetching and looping while letting the parent decide how to render each item. That inverts control: the child owns behaviour and the parent owns presentation.

4

How do you pass data from a child component to its parent?

Answer

The child declares events with defineEmits and calls emit with a payload, and the parent listens with v-on. For two-way binding on a single value, v-model is sugar over a prop plus an update event. Directly mutating a prop is not allowed because it breaks the one-way data flow that makes state changes traceable.

5

What is Pinia and why is it preferred over Vuex?

Answer

Pinia is the official state library for Vue 3: stores are plain functions with state, getters, and actions, and there are no mutations. It infers TypeScript types without manual annotation, supports modular stores by default instead of nested modules, and works with both the Options and Composition APIs. The result is less boilerplate and far better editor support than Vuex.

6

What is the difference between v-if and v-show?

Answer

v-if adds or removes the element from the DOM, so it costs a mount and unmount but avoids rendering anything when false — right for content that rarely toggles or is expensive. v-show always renders the element and toggles CSS display, so switching is cheap but the component is always constructed. Use v-show for something toggled frequently, such as a dropdown.

🦎

Reading answers is not enough

In a real interview you speak under pressure. Cam asks these same questions, scores every answer, and shows exactly what to fix.

Practice a Senior Vue Frontend interview →
Free · 3 interviews per month

Other levels — Vue Frontend

Junior Vue FrontendMiddle Vue FrontendAll Vue Frontend questions

Other specializations

🔍Senior Manual QA🤖Senior QA AutomationSenior Java Backend🐍Senior Python Backend🐘Senior PHP Backend🦫Senior Go Backend🟢Senior Node.js Backend⚛️Senior React Frontend🅰️Senior Angular FrontendSenior Next.js