Top 30 Vue, Angular & Svelte Concepts Quiz
30 multiple-choice questions on the Vue, Angular & Svelte fundamentals, drawn from 30 bites in the Vue, Angular & Svelte library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
Vue 3, Nuxt, Angular, Svelte, SvelteKit
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
What is the primary advantage of Vue's progressive philosophy for a project starting small but potentially growing into a full SPA?
Show the answer
Answer: b · It enables developers to integrate only the necessary parts of its ecosystem, scaling functionality as needed.
The progressive philosophy allows Vue to be adopted incrementally, starting with its core library for small enhancements and gradually integrating more of its ecosystem as the project's complexity grows. Option A is incorrect because Vue is designed to be less opinionated, offering flexibility rather than strict guidance from the outset.
Read the full bite: Vue: The Progressive Framework Philosophy
Question 2 of 30
What is a key characteristic of Angular's 'batteries-included' philosophy?
Show the answer
Answer: b · It provides a complete, integrated toolkit, promoting consistency and reducing decision fatigue.
Angular's 'batteries-included' approach means it provides a comprehensive, integrated toolkit for common needs like routing and forms, which promotes consistency and reduces decision fatigue. Option C is incorrect because Angular's opinionated nature limits flexibility in favor of integration and consistency.
Read the full bite: Angular: The 'Batteries-Included' Framework
Question 3 of 30
What is the primary benefit of Svelte's architecture as a compiler, rather than a traditional runtime framework?
Show the answer
Answer: a · It generates highly optimized, vanilla JavaScript during the build process, eliminating the need for a runtime library in the browser.
The card emphasizes that Svelte shifts work from runtime to compile time, generating efficient vanilla JavaScript and avoiding a large runtime library, which leads to smaller bundles and improved performance. While Svelte does offer a declarative syntax (option C), this is a feature of many frameworks and not the primary benefit of its *compiler* architecture.
Read the full bite: Svelte: A Compiler, Not Just a Framework
Question 4 of 30
What is the primary advantage Angular gains by building upon TypeScript?
Show the answer
Answer: a · It provides static type checking and structural contracts, crucial for building large, maintainable, and error-resistant applications.
The card states that TypeScript provides static type checking and structural guarantees, which are essential for Angular to build large, scalable, and maintainable applications by catching errors early. Option C is incorrect because while TS compiles to optimized JS, its primary benefit for Angular is not just runtime speed but compile-time safety and structure.
Question 5 of 30
A developer chooses Vue Single-File Components (SFCs) for a new application. What is the most significant implication regarding how their code will be processed for the browser?
Show the answer
Answer: c · A build tool will be necessary to compile the .vue files into standard JavaScript and CSS that browsers can execute.
The card explicitly states that .vue files are not directly understood by browsers and require a build tool to compile them into standard JavaScript and CSS. Option D is incorrect because SFCs cannot be directly interpreted by browsers.
Question 6 of 30
When a service is provided within a specific component's providers array, what is the primary outcome?
Show the answer
Answer: d · A new instance of the service is created for that component and its descendants, isolated to that part of the UI.
Providing a service at the component level creates a new instance of that service, scoped to that component and its children, allowing for isolated state within a UI branch. This differs from `providedIn: 'root'`, which creates an application-wide singleton.
Read the full bite: Angular's Hierarchical Dependency Injection
Question 7 of 30
How does Svelte fundamentally differ from Virtual DOM-based frameworks in its approach to updating the user interface?
Show the answer
Answer: d · Svelte compiles components into vanilla JavaScript that directly modifies the DOM based on state changes, eliminating runtime diffing.
Svelte is a compiler that generates highly optimized JavaScript to directly update the DOM when state changes, completely bypassing the Virtual DOM and its runtime diffing process. Option B is incorrect because Svelte eliminates the VDOM entirely, it doesn't optimize it.
Question 8 of 30
When developing a complex Vue component with intertwined logic for a single feature (e.g., data fetching and its related states), which API is generally preferred and why?
Show the answer
Answer: a · Composition API, because it enables grouping all related logic for a feature together, enhancing co-location and reusability.
The Composition API is preferred for complex components because it allows grouping all related logic for a specific feature, like data fetching and its states, in one place, improving co-location and reusability. The Options API, conversely, tends to scatter such related logic across different sections (data, methods, mounted), making complex components harder to manage and debug.
Question 9 of 30
How does Vue's reactivity system primarily ensure UI components update automatically with data changes?
Show the answer
Answer: b · It wraps data objects in JavaScript Proxies to intercept property access and modification, triggering updates when changes occur.
Vue's reactivity system uses JavaScript Proxies to wrap data, intercepting 'get' operations to track dependencies and 'set' operations to notify subscribers for updates. Option A describes a polling mechanism, which is not how Vue's event-driven reactivity works.
Read the full bite: Vue's Reactivity: JavaScript That Acts Like a Spreadsheet
Question 10 of 30
What is the primary function of the `create-vite` tool?
Show the answer
Answer: c · To generate a new web application project with a chosen framework and pre-configured Vite setup.
The card describes `create-vite` as a "project wizard or a blueprint generator" for "creating new projects from scratch." It explicitly states that it is not for adding Vite to an existing project, which makes option A incorrect.
Read the full bite: Scaffolding a Vite Project with `create-vite`
Question 11 of 30
What is the primary function of the `ng new` command in Angular development?
Show the answer
Answer: d · To set up a complete, ready-to-run Angular application from scratch.
The `ng new` command is designed to initialize a brand new Angular project, providing a complete, runnable application with a standard structure and dependencies. Adding features to an existing project is typically done with `ng generate`.
Read the full bite: ng new: Your Angular Project Starter Kit
Question 12 of 30
What is the correct sequence of commands to initialize a new SvelteKit project and start its development server?
Show the answer
Answer: b · npx sv create my-app, then cd my-app, then npm install, then npm run dev
The card explicitly states the process: first create the project with npx sv create, then navigate into the directory with cd, install dependencies with npm install, and finally start the server with npm run dev. Option A is a common mistake because it omits the crucial npm install step, which the card identifies as a 'footgun'.
Question 13 of 30
What is the critical reason for wrapping Vite's HMR API calls within an if (import.meta.hot) block?
Show the answer
Answer: b · To prevent runtime errors in the production build where import.meta.hot is undefined.
The card states that forgetting this wrapper will 'crash your production build' because 'import.meta.hot is undefined' in production. Option A describes the function of hot.accept(), not the purpose of the conditional check itself.
Read the full bite: Vite's HMR API: Manually Controlling Hot Reloads
Question 14 of 30
What is the main reason vite.config.js is designed as a Node.js script capable of exporting a function?
Show the answer
Answer: b · To enable programmatic configuration adjustments based on the current command or environment mode.
The card emphasizes that vite.config.js is a dynamic script allowing conditional logic based on context like 'command' or 'mode', which is the core purpose of exporting a function. While defineConfig (Option C) is a benefit, it's not the primary reason for the dynamic script design itself.
Read the full bite: Vite Config: The Control Panel for Your Build
Question 15 of 30
For what primary purpose is a SvelteKit adapter indispensable?
Show the answer
Answer: a · To translate the built application for a specific production hosting environment.
SvelteKit adapters are essential for bridging the gap between SvelteKit's platform-agnostic build and the specific requirements of a production hosting environment. The card explicitly states that adapters are not needed during local development, as the vite dev server handles everything.
Read the full bite: SvelteKit Adapters: Bridge Your App to Production
Question 16 of 30
When configuring a Vite plugin, for what primary reason would you use the 'enforce' property?
Show the answer
Answer: d · To control the plugin's execution order relative to other plugins and Vite's core.
The card states that 'enforce: 'pre' or enforce: 'post' forces a plugin to run before or after Vite's core plugins, which is crucial for resolving compatibility issues.' The 'apply' property is used to restrict a plugin to run only during development or production builds.
Read the full bite: Vite's Plugin System: Extending Dev and Build
Question 17 of 30
When is Vite's low-level SSR API the most appropriate choice for a project?
Show the answer
Answer: b · When building a custom SSR framework or requiring unique server-side rendering control beyond existing plugins.
The low-level SSR API is designed for advanced scenarios like framework development or highly custom server environments, offering full control. It is explicitly advised against for standard applications using popular frameworks, which should leverage higher-level SSR plugins.
Question 18 of 30
Which task is the most appropriate use case for a SvelteKit server hook?
Show the answer
Answer: b · Initializing a database connection pool that is shared across all server-side requests.
The card explicitly states that "startup behavior (code at the top level of a hooks file) is ideal for initializing singletons like a database connection pool." This makes initializing a shared resource like a DB pool a primary use case for server hooks. While hooks can handle custom routing (like option A), defining standard API endpoints is typically done using dedicated +server.js files, whereas hooks are more for intercepting and modifying requests or handling non-standard routing.
Read the full bite: SvelteKit Hooks: Intercepting Requests and Events
Question 19 of 30
Which pair of issues does Vite's dependency pre-bundling primarily resolve to enhance development server performance?
Show the answer
Answer: a · Converting CommonJS modules to browser-native ESM and consolidating packages with many files into single requests.
Vite's pre-bundling specifically converts CommonJS modules into browser-native ESM and merges multi-file packages into single requests, directly addressing browser limitations that slow down development. Distractors describe production optimizations or general build features not specific to pre-bundling's core purpose.
Question 20 of 30
Which statement accurately describes a fundamental principle of using props in Vue components?
Show the answer
Answer: b · A child component must never directly mutate a prop it receives from its parent.
The card explicitly states that a critical rule is to 'never mutate a prop directly inside the child component,' emphasizing the one-way data flow principle. Options A and B describe incorrect data flow patterns, while option C suggests a less robust declaration method than recommended.
Read the full bite: Vue Component Props: Passing Data Downstream
Question 21 of 30
Which statement accurately describes data passed to an Angular component using the input() function?
Show the answer
Answer: d · The child component receives a read-only signal, preventing it from directly modifying the data.
The card explicitly states that the `input()` function returns a "read-only signal" and that "the child cannot modify its own input." This enforces a one-way data flow from parent to child, making options suggesting two-way binding or child modification incorrect.
Read the full bite: Angular's input() Function: Passing Data to Components
Question 22 of 30
What happens if a Svelte component uses `let myProp;` instead of `export let myProp;` when intending to receive data from its parent?
Show the answer
Answer: a · The `myProp` variable will remain private to the component and will not receive data from the parent.
Declaring `let myProp;` without `export` makes the variable private to the component, preventing it from receiving data passed as a prop from a parent. The card explicitly calls this a 'footgun' where the component silently fails to receive data, rather than throwing an error or inferring the prop.
Read the full bite: Svelte Props: Passing Data with `export let`
Question 23 of 30
What is the primary purpose of using a custom event ($emit) in a Vue component?
Show the answer
Answer: c · To allow a child component to send data or signals to its direct parent.
The card explicitly states that custom events provide a "dedicated channel for child-to-parent communication" and that "events only travel one level up to the direct parent." Option A is wrong because the card advises against using $emit for sibling communication.
Read the full bite: Vue Custom Events: Child-to-Parent Communication
Question 24 of 30
How does an Angular child component typically notify its immediate parent about an internal event, such as a button click?
Show the answer
Answer: d · By using an @Output() property initialized with EventEmitter and calling its emit() method.
The @Output() decorator, paired with an EventEmitter and its emit() method, is the canonical Angular pattern for a child component to send events and data upwards to its immediate parent. Option B describes a pattern for communication between distant components, not the immediate parent. Options B and D are not the standard or recommended Angular approaches for this specific child-to-parent event notification.
Read the full bite: Angular @Output(): Child Components Reporting Up
Question 25 of 30
For which scenario is Svelte's on:eventname directive NOT the recommended approach?
Show the answer
Answer: a · Allowing a child component to send data or a notification to its parent.
The card explicitly states that on:eventname is not for communication between components, which requires Svelte's custom event dispatcher. Options A, C, and D describe appropriate uses of on:eventname for handling standard DOM events within a component.
Question 26 of 30
When content is projected into a Vue slot, what is true regarding its data scope?
Show the answer
Answer: c · It can access data properties defined within the parent component that provides the content.
The card explicitly states that "the slot content is defined in the parent, so it has access to the parent's data scope, not the child's." This means expressions within the slot content resolve against the parent's data, not the child's.
Read the full bite: Vue Slots: Projecting Content into Components
Question 27 of 30
Which statement accurately describes a critical behavior or limitation of Angular's ng-content?
Show the answer
Answer: c · It always instantiates and renders the projected content, even if the ng-content element is hidden by a conditional directive.
The card explicitly warns that 'Angular always instantiates the projected content, even if the <ng-content> tag is inside a hidden block,' making it a performance concern with conditional directives. A common misconception is that conditional directives like @if would prevent rendering, but for projected content, this is not the case.
Read the full bite: Angular Content Projection with ng-content
Question 28 of 30
To ensure injected data updates reactively in descendant components, what must be true about the provided value?
Show the answer
Answer: a · It must be a reactive object, such as one created with ref() or reactive().
The card states that for data to be reactive, you must provide a reactive object like one created with ref() or reactive(). Providing a static or primitive value will not trigger updates in child components if it changes in the parent.
Question 29 of 30
When is Svelte's Context API the most appropriate solution for sharing data?
Show the answer
Answer: a · To provide data to a specific component subtree, bypassing intermediate components.
The Context API is specifically designed to avoid prop-drilling by making data available to all descendants within a specific component subtree. For app-wide reactive state, Svelte Stores are generally preferred, and for direct parent-child communication, props are more suitable.
Question 30 of 30
When would you primarily use Svelte slot props?
Show the answer
Answer: d · To enable a generic child component to provide data for each item, letting the parent customize the rendering of those items.
Slot props allow a child component to pass its internal data up to the parent for custom rendering, enabling the parent to control the presentation of items managed by the child. Option A describes the inverse control flow, where the child defines rendering and the parent supplies data, which is not the primary purpose of slot props.
Read the full bite: Svelte Slot Props: Child Informs, Parent Renders
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.