Vue.js

Composition API, reactivity, and runtime behavior — common themes in Vue-focused interview loops.

Core concepts

EasyIn progress

Vue cheatsheet

Options vs Composition API at a glance — refs, lifecycle hooks, and slots vocabulary.

Vue 3 cheatsheet

Composition API, reactivity, and how Vue compares to React in interviews.

script setup

  • Top-level bindings (refs, functions, imports) are exposed to the template automatically — less boilerplate than Options API setup() return object.
  • Use defineProps / defineEmits compiler macros for typed props and events.

Reactivity

  • ref — reactive primitive or object; access .value in script, unwrap in template.
  • reactive — proxy object; good for local form state; lose reactivity if you destructure without toRefs.
  • computed — derived state with caching; analogous to memoized selectors.

watch vs watchEffect

  • watch(source, cb) — lazy; runs when tracked sources change; access previous value.
  • watchEffect — runs immediately; auto-tracks dependencies — closer to “sync effect” mental model.

Provide / inject

  • Dependency injection across the tree — compare to React Context; mind readability and update frequency.
  • Prefer explicit props for shallow trees; provide/inject for plugin-style or deeply nested shared services.

Router (Vue Router 4)

  • useRouter() / useRoute() in Composition API — programmatic navigation vs reading params.
  • Navigation guards (global, per-route, in-component) — common senior-level discussion topic.

Interview angles

  • Reactivity caveats with arrays/objects replacement vs mutation depending on API choice.
  • Performance: v-once, v-memo, async components, and when to split SFCs.
MediumNot started

Composition API playground

Wire reactive state and lifecycle in the browser — narrate script setup ergonomics.