Frontend Interview Questions

Vue 2 vs Vue 3: The Core Differences

What's new in Vue 3 versus Vue 2?

Why Interviewers Ask This

Most Vue teams are migrating. Expect this in any Vue-focused interview.

How to Answer

  1. 1

    Reactivity: Vue 2 uses Object.defineProperty (can't detect new property additions, array index set); Vue 3 uses Proxy (intercepts everything).

  2. 2

    API: Options API (data, methods, computed) → Composition API (setup, ref, reactive) — better logic reuse, better TS inference.

  3. 3

    Multi-root: Vue 3 supports Fragment (multiple root nodes in template).

  4. 4

    Performance: rewritten compiler with static hoisting, patch flags, and tree-shaking friendly runtime — ~40% smaller bundles, faster updates.

  5. 5

    Teleport for portals, Suspense for async components, custom renderer API — all new.

Sample Answer

Biggest three for me: reactivity rewrite (Proxy lets you react to new property additions and array index writes without $set), Composition API (setup + ref/reactive enables extracting reusable "composables" the way React hooks do), and the compiler rewrite (static hoisting + patch flags mean Vue 3 ships less code per update). TypeScript story went from "possible but painful" in Vue 2 to first-class in Vue 3 — script setup + defineProps is really nice. For migration I'd pick Composition API for new files but leave Options API code alone; the two coexist and mixing is fine.

Pro Tips

  • Vue 2 is end-of-life as of Dec 2023 — new projects must be Vue 3.

  • Pinia replaced Vuex as the official store in Vue 3.

  • HireMe AI (即答侠) highlights the reactivity gotchas (Vue 2 $set, Proxy limits on Maps) — interviewers love edge-case trivia here.

Frequently Asked Questions

Does Proxy work on Map/Set?

Yes, but Vue 3 wraps collection handlers specially — direct Proxy on Map returns unwrapped values, so Vue's reactive() wraps them with tracked collection handlers.

Can I use Composition API in Vue 2?

@vue/composition-api plugin backports most of it to Vue 2.7+. It's the recommended pre-migration step.

Worried About Going Blank in Your Interview?

HireMe AI listens to your interview in real-time, detects questions, and generates instant answer suggestions — so you never freeze up again.

Try HireMe AI Free