Tooling & Build Questions with Answers

8 practice questions on Tooling & Build (Vue.js) with answers and step-by-step solutions. Try 8 samples below, then practise all 8 free in the AptiNest app.

Sample questions

Question 1Easy

What is a .vue file called?

  1. A Single File Component (SFC)
  2. A Vue module bundle that contains every compiled component of the whole application
  3. A style sheet
  4. A package manifest

Answer: A. A Single File Component (SFC)

Explanation

An SFC can contain <template>, <script> and <style> blocks.

Step-by-step solution

  1. Open a .vue file.
  2. See three blocks.

Why the other options are wrong

  • B. An SFC is one component file, not a bundle of every compiled component.
  • C. It also has template and script.
  • D. package.json is the manifest.

Question 2Easy

Which API creates the app in Vue 3?

  1. new Vue({ render: h => h(App) }).$mount('#app'), the form used by Vue 2
  2. Vue.createInstance()
  3. createApp(App).mount('#app')
  4. mountApp(App)

Answer: C. createApp(App).mount('#app')

Explanation

Vue 3 uses the createApp factory; multiple isolated apps are possible.

Step-by-step solution

  1. Call createApp.
  2. Mount to a selector.

Why the other options are wrong

  • A. That is Vue 2 style.
  • B. Vue.createInstance() is not a Vue API for this; the correct choice is createApp(App).mount('#app').
  • D. mountApp(App) is not a Vue API for this; the correct choice is createApp(App).mount('#app').

Question 3Easy

What replaced Vuex as the officially recommended state library?

  1. Redux
  2. Pinia
  3. MobX
  4. Zustand

Answer: B. Pinia

Explanation

Pinia has a simpler API with no mutations and better TypeScript support.

Step-by-step solution

  1. Install Pinia.
  2. Use defineStore.

Why the other options are wrong

  • A. React ecosystem.
  • C. Different ecosystem.
  • D. React ecosystem.

Question 4Easy

Which tool is the commonly recommended build tool/dev server for new Vue 3 projects?

  1. Grunt
  2. Gulp
  3. Bower
  4. Vite

Answer: D. Vite

Explanation

Vite offers native-ESM dev serving and fast builds; npm create vue@latest scaffolds with it.

Step-by-step solution

  1. Scaffold with create-vue.
  2. Run the dev server.

Why the other options are wrong

  • A. Older task runner.
  • B. Older task runner.
  • C. Package manager that is obsolete.

Question 5Medium

What is .env prefix needed to expose a variable to client code in Vite?

  1. VUE_
  2. PUBLIC_
  3. VITE_
  4. APP_

Answer: C. VITE_

Explanation

Only variables starting with VITE_ are exposed via import.meta.env.

Step-by-step solution

  1. Name VITE_API_URL.
  2. Read import.meta.env.VITE_API_URL.

Why the other options are wrong

  • A. That was Vue CLI.
  • B. Other frameworks use it.
  • D. Vite exposes only variables prefixed with VITE_, not APP_.

Tip: Never put secrets in client-exposed variables.

Question 6Medium

Which is a Vue 3 change from Vue 2 for templates?

  1. Templates must have exactly one root
  2. Templates are removed
  3. Only JSX is allowed
  4. Components may have multiple root nodes (fragments)

Answer: D. Components may have multiple root nodes (fragments)

Explanation

Fragments allow multiple root elements, though attribute fallthrough then needs explicit $attrs.

Step-by-step solution

  1. Vue 2 needed a single root.
  2. Vue 3 allows fragments.

Why the other options are wrong

  • A. That was Vue 2.
  • B. Templates remain.
  • C. JSX is optional in Vue 3; templates remain the default.

Question 7Medium

What is tree shaking in the context of Vue 3?

  1. Removing unused CSS only, since scripts are always included in full by the bundler
  2. Unused APIs are removed from the bundle because Vue exposes modular imports
  3. Removing comments
  4. Deleting unused files from disk

Answer: B. Unused APIs are removed from the bundle because Vue exposes modular imports

Explanation

Global APIs became named exports, so bundlers can drop what you do not import.

Step-by-step solution

  1. Import named APIs.
  2. Bundler prunes the rest.

Why the other options are wrong

  • A. It is about JS exports.
  • C. Not about comments.
  • D. Not file deletion.

Question 8Hard

How does Vue 3 reactivity differ from Vue 2 for newly added object properties?

  1. Proxies detect added properties; Vue 2's Object.defineProperty could not
  2. Both need Vue.set, because neither version can notice a property added later
  3. Neither detects them
  4. Vue 3 uses polling

Answer: A. Proxies detect added properties; Vue 2's Object.defineProperty could not

Explanation

Proxy traps catch property addition and deletion, array index assignment and length changes.

Step-by-step solution

  1. Vue 2 used getters/setters.
  2. Vue 3 uses Proxy.

Why the other options are wrong

  • B. Vue 3 does not need it.
  • C. Proxy tracks adds.
  • D. No polling.

Practise all 8 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Vue.js topics · All topics