Top 30 Intermediate Vue, Angular & Svelte Concepts Quiz
30 intermediate multiple-choice Vue, Angular & Svelte concept questions, the mechanics underneath the basics: how the pieces relate and where the usual mental model stops holding. They come from 30 bites in the Vue, Angular & Svelte library, the middle slice of the 160 Vue, Angular & Svelte concept questions in the 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
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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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 10 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 11 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 12 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 13 of 30
Which Angular approach is best for quickly synchronizing a simple form input with a component property, ensuring immediate updates in both directions?
Show the answer
Answer: b · Applying two-way data binding with [(ngModel)].
The card states that [(ngModel)] is "perfect for things like settings toggles, search bars, or basic data entry fields in a prototype or a small, self-contained component" because it automates the synchronization. While separate property and event binding (Option A) can achieve two-way flow, [(ngModel)] is the concise, direct solution for simple scenarios.
Question 14 of 30
What is the primary issue Vue's `key` attribute addresses when rendering dynamic lists with stateful components?
Show the answer
Answer: c · Preserving the internal state of individual list items across re-renders when the list order changes.
The card states that `key` is vital for "preserving each item's state across re-renders" and preventing "state mismatches" in dynamic lists, especially with "stateful components, like form inputs." Option B is incorrect because `key` manages DOM reconciliation, not data binding mechanisms.
Read the full bite: Vue List Rendering: Why `key` is Not Optional
Question 15 of 30
What is the main advantage of implementing a trackBy function with *ngFor in Angular?
Show the answer
Answer: d · It allows Angular to efficiently update the DOM by reusing elements instead of re-rendering them entirely.
The card explicitly states that trackBy prevents Angular from destroying and recreating the entire list in the DOM on every data update, instead allowing it to reuse existing elements. Option C is incorrect because trackBy primarily optimizes subsequent updates, not the initial rendering, and doesn't involve pre-caching.
Read the full bite: *ngFor trackBy: Smarter DOM Updates in Angular
Question 16 of 30
For which scenario would a Vue template ref be the most appropriate tool?
Show the answer
Answer: c · To programmatically set focus on an input field after the component mounts.
The card explicitly states that programmatic focus on an input is a canonical example and a key use case for template refs, as it requires direct DOM interaction. Option D describes the use of ref() for reactive data, which is distinct from using the ref attribute in the template to get a direct DOM element reference.
Read the full bite: Vue Template Refs: Reaching Past the Virtual DOM
Question 17 of 30
Which scenario would lead to a loss of reactivity or an error when using Vue's Composition API?
Show the answer
Answer: a · Destructuring a property from a reactive() object into a local variable.
The card states that "losing reactivity when destructuring" is a major footgun with reactive(). The destructured variable becomes a plain value, losing its connection to the reactive state. Options A, C, and D describe correct and intended uses of ref() and reactive() respectively, which maintain reactivity.
Read the full bite: ref() vs. reactive(): Vue's Two Flavors of Reactivity
Question 18 of 30
According to the card, what is the primary reason to use a computed property for complex logic instead of an in-template expression?
Show the answer
Answer: c · To keep templates clean and readable by moving complex calculations out of the markup.
The card explicitly states that computed properties exist "to move this complex, reactive logic out of the template" to keep them "clean and readable" and "separate calculation from presentation." While caching (option D) is a benefit of computed properties, the primary reason highlighted for using them with complex logic over in-template expressions is the improvement in template clarity and maintainability.
Read the full bite: Vue Computed Properties: Derived Values for Cleaner Templates
Question 19 of 30
In a Svelte 5+ application, when is a Svelte Store the most appropriate choice?
Show the answer
Answer: a · To handle complex asynchronous data flows or require explicit state transition control.
Svelte Stores are best for complex asynchronous data flows (e.g., WebSockets) or when explicit control over state transitions is needed. For simple shared state, Svelte 5's $state runes are now the preferred and more performant solution.
Read the full bite: Svelte Stores: State for Async Streams & Legacy Apps
Question 20 of 30
A child component uses ngOnChanges to react to its @Input() properties. In which scenario would this hook *not* be reliably triggered?
Show the answer
Answer: d · A parent component modifies a nested property of an object already passed via an @Input() property.
The card explicitly states that ngOnChanges does not detect mutations inside an object or array if the object reference itself has not changed. Modifying a nested property of an existing input object does not change its reference, preventing ngOnChanges from firing. The other options all involve changing the input's reference, which correctly triggers the hook.
Read the full bite: ngOnChanges: Reacting to Input Property Changes
Question 21 of 30
To model a user profile form with fixed fields like name and email, plus a dynamic list of work experiences (each with title, company, and dates), which Reactive Form classes are most appropriate?
Show the answer
Answer: c · A top-level FormGroup, with FormControls for name/email and a FormArray for work experiences.
A FormGroup is used for a fixed collection of controls (the overall profile), FormControls for individual input fields (name, email), and a FormArray for a dynamic list of controls (work experiences). Option B is incorrect because a FormArray is for dynamic lists, not the top-level structure of a form with fixed fields.
Read the full bite: Angular's Reactive Form Classes: FormControl, FormGroup, FormArray
Question 22 of 30
For which scenario are SvelteKit Form Actions primarily designed?
Show the answer
Answer: d · Handling operations that modify server-side data, such as user registration.
Form Actions are specifically for operations that change server state based on user input, like creating or updating database records, which includes user registration. Fetching data without side-effects is handled by SvelteKit's load functions, not Form Actions.
Read the full bite: SvelteKit Form Actions: Server-Side Logic for Forms
Question 23 of 30
What is the primary advantage of using VeeValidate for form development in Vue?
Show the answer
Answer: a · It significantly reduces boilerplate code by managing form values, validation, and submission lifecycle.
VeeValidate's core purpose is to manage the entire lifecycle of a Vue form, including values, validation, and submissions, specifically to eliminate repetitive boilerplate code. It is a dedicated state machine for forms, not a general application state manager, nor does it provide UI components or automate backend API creation.
Read the full bite: VeeValidate: Vue Forms Without the Boilerplate
Question 24 of 30
For which scenario is TanStack Query the most appropriate state management tool?
Show the answer
Answer: b · Caching and synchronizing a list of items from a remote database.
TanStack Query is designed for asynchronous server state, such as fetching and caching data from a remote API. The other options describe synchronous client-side UI state, which is best managed with standard client-side state tools like useState.
Read the full bite: TanStack Query: Managing Server State, Not Client State
Question 25 of 30
When navigating from /users/johnny to /users/jolyne using the same User component, what is the key behavior to manage?
Show the answer
Answer: d · The User component instance is reused, requiring explicit handling to fetch data for jolyne.
The card highlights that the component instance is reused for efficiency when only parameters change, meaning lifecycle hooks like mounted() won't refire. Developers must explicitly react to parameter changes using watchers or navigation guards to fetch new data, rather than relying on automatic re-initialization or data fetching.
Question 26 of 30
What is the primary benefit of using nested routes in an application?
Show the answer
Answer: c · To display dynamic content within a consistent parent component's layout, keeping the parent active.
Nested routes are designed for hierarchical UI structures, allowing a parent component to provide a stable layout while child components render dynamically within its designated area. Option B is incorrect because nested routes simplify *hierarchical* routing, not necessarily all routing, especially for flat structures.
Read the full bite: Nested Routes: Mapping URLs to Component Trees
Question 27 of 30
According to modern Vue Router practices, what is the primary concern with using the next() callback in navigation guards?
Show the answer
Answer: d · It can lead to unpredictable navigation states if called multiple times or not at all.
The card states that the next() callback is a "footgun" and "must be called exactly once per code path," as calling it incorrectly "can break navigation." Modern practice avoids it by returning values for safer and clearer control, not because it prevents asynchronous operations or is deprecated.
Question 28 of 30
What is the main problem that file-based routing aims to solve compared to traditional routing approaches?
Show the answer
Answer: d · The potential for URL paths and their corresponding component files to become out of sync.
File-based routing was created to eliminate the 'two sources of truth' problem, where a separate central configuration file could easily fall out of sync with component files. It makes the filesystem the single source of truth for routes. While it simplifies dynamic routes (Option A) and offers intuitive structure (Option C), these are benefits stemming from solving the core synchronization problem, not the primary problem itself.
Read the full bite: File-Based Routing: Your Filesystem is Your API
Question 29 of 30
When is it most appropriate to use ActivatedRoute.queryParams (Observable) to access URL query parameters?
Show the answer
Answer: d · When you need to react to changes in query parameters while the same component instance is active.
The `queryParams` Observable provides live updates, making it ideal for components that are reused by the router and need to react to parameter changes without being re-instantiated. The `snapshot` (options A and D) is for one-time reads when the component is certain to be destroyed and re-created, while option C describes route parameters, not query parameters.
Question 30 of 30
When two distinct Vue components use the same composable, what is the expected behavior regarding the state managed by that composable?
Show the answer
Answer: c · Each component will receive its own independent state instance.
The card explicitly states that 'Each component that calls a composable gets its own separate instance of that state,' making them independent. Option B describes a common misconception, as composables are not designed for shared global state, which requires a dedicated state management library.
Read the full bite: Vue Composables: Reusable Stateful Logic
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.