Skip to content
tezvyn:

Top 30 Easy Vue, Angular & Svelte Interview Questions and Answers for Freshers

30 easy multiple-choice Vue, Angular & Svelte interview questions, the ones an interviewer opens with: definitions, everyday syntax, and the quick checks that you have really used it. They come from 30 bites in the Vue, Angular & Svelte library, the gentlest slice of the 136 Vue, Angular & Svelte interview 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.

  1. Question 1 of 30

    Which approach correctly applies Vue's progressive philosophy to a legacy server-rendered page?

    Show the answer

    Answer: b · Dropping in a CDN script tag to enhance one form, then migrating that component to a Vite SFC later

    Vue is progressive because it supports incremental adoption, letting you enhance one element with a CDN script and later scale to a compiled SFC project. Option A is a common misconception because progressive refers to layer-by-layer adoptability, not a small bundle size.

    Read the full bite: Explain Vue as a progressive framework and build-step differences

  2. Question 2 of 30

    Which built-in Angular module is specifically designed for handling user input and validation, a capability that Vue and Svelte projects typically address through external libraries such as VeeValidate or FormKit?

    Show the answer

    Answer: a · Template-driven and reactive forms

    Angular ships template-driven and reactive forms with built-in validators as a first-party module, while Vue and Svelte generally rely on community libraries like VeeValidate or FormKit for equivalent functionality. NgRx is the most tempting distractor because it is a third-party state management library, not a built-in Angular feature.

    Read the full bite: What out-of-the-box Angular features require manual setup in Vue or Svelte?

  3. Question 3 of 30

    How does Svelte's compiler-first design most directly improve the end-user experience compared to virtual DOM frameworks?

    Show the answer

    Answer: a · It shifts work to build time, producing smaller bundles and less browser CPU work for faster page loads.

    Svelte's compiler generates imperative vanilla JavaScript at build time, which shrinks bundles and eliminates virtual DOM diffing overhead for end users. Option D describes a developer experience benefit, not a user-facing performance improvement.

    Read the full bite: What is the primary end-user benefit of Svelte's compiler-first approach?

  4. Question 4 of 30

    You need to generate deployable files to upload to a web server. Why should you use ng build instead of ng serve?

    Show the answer

    Answer: c · ng build writes the compiled output to the dist/ folder, while ng serve keeps the build in memory and starts a dev server

    ng build writes static files to the dist/ folder for deployment, while ng serve keeps output in memory and runs a dev server. Many beginners incorrectly think ng serve also writes files to disk, but it never produces disk output.

    Read the full bite: ng serve purpose and fundamental difference from ng build

  5. Question 5 of 30

    What does create-vue's practice of asking about Pinia and Vitest reveal about Vue's overall framework design?

    Show the answer

    Answer: a · Vue prefers to keep its runtime core small and let developers opt into official ecosystem tools only when needed.

    This reflects Vue's intentional design as a lean runtime with an opt-in ecosystem, keeping bundle sizes down and avoiding forced opinions. Distractor D is tempting because it suggests flexibility, but the prompts are one-time scaffolding decisions that permanently shape the project skeleton and lockfile, not runtime toggles.

    Read the full bite: Why does create-vue ask about Pinia and Vitest during scaffolding?

  6. Question 6 of 30

    You place a helper component named utils.svelte inside src/routes/dashboard/. What is true about its routing behavior?

    Show the answer

    Answer: a · It does not create a route because SvelteKit requires the plus prefix for route files

    SvelteKit only treats files starting with + as route files, so utils.svelte is ignored for routing and does not create a page. Option C reflects the common misconception that any .svelte file inside src/routes automatically becomes a public route.

    Read the full bite: How does src/routes determine routing in SvelteKit?

  7. Question 7 of 30

    Which of the following would violate encapsulation in a reusable Button component?

    Show the answer

    Answer: c · Providing a class or style prop for consumer style overrides

    Exposing a class or style prop creates an escape hatch that breaks encapsulation by letting consumers override internal styles, making the component unmaintainable at scale. Variant, slots, and native event forwarding are all encouraged practices for a clean, composable API.

    Read the full bite: Design the public API for a reusable Button component

  8. Question 8 of 30

    Which approach should a child component use when it needs to change data received from its parent via props?

    Show the answer

    Answer: d · Emit an event or invoke a callback to ask the parent to update the data.

    The child should treat props as read-only and request changes through events or callbacks, preserving unidirectional data flow and predictable state ownership. Directly mutating the prop (option B) breaks the explicit contract and makes debugging difficult because the parent loses control over its own state.

    Read the full bite: Primary mechanism for passing data from parent to child component

  9. Question 9 of 30

    When a child must notify its parent of a new search query, which approach preserves proper encapsulation in Vue and Angular?

    Show the answer

    Answer: c · The child declares an event via defineEmits in Vue or @Output EventEmitter in Angular and emits the query upward.

    Emitting a named, typed event through defineEmits or @Output/EventEmitter keeps the parent in control of state and follows framework conventions. Option D is tempting because direct mutation seems efficient, but it violates unidirectional data flow and breaks component encapsulation.

    Read the full bite: How do you emit events from a child to parent component?

  10. Question 10 of 30

    A sidebar card is toggled ten times a minute. Why prefer v-show over v-if?

    Show the answer

    Answer: d · v-show keeps the node mounted and preserves internal state

    v-show keeps the element in the DOM and only flips CSS display, preserving internal state and avoiding costly mount cycles during frequent toggles. Distractor B is wrong because toggling display CSS describes v-show, whereas v-if actually removes the element from the DOM.

    Read the full bite: How do you conditionally render Login/Logout with isLoggedIn in Vue or Angular?

  11. Question 11 of 30

    When you write v-model or [(ngModel)] in a template, what is the framework actually doing under the hood?

    Show the answer

    Answer: c · It is shorthand for binding a value property downward and listening for an update event upward

    Two-way binding is syntactic sugar for a property pushing data down and an event pushing changes back up. Option D is a common misconception: the view does not mutate state directly; frameworks use explicit events to update the model.

    Read the full bite: Explain two-way data binding and provide input binding syntax

  12. Question 12 of 30

    Which accurately describes a key difference between Vue 3's ref() and reactive()?

    Show the answer

    Answer: b · ref() requires accessing state through .value in script, while reactive() allows direct property access.

    ref() wraps any value in an object accessed via .value in script, while reactive() returns a proxy you access directly. Option C is a tempting misconception: ref() is not limited to primitives and is the recommended default for most state.

    Read the full bite: Vue 3 ref() vs reactive(): differences and when to use each

  13. Question 13 of 30

    Why should initialization logic that reads @Input values be placed in ngOnInit instead of the constructor?

    Show the answer

    Answer: c · Because input properties are guaranteed to have their initial bound values in ngOnInit but not in the constructor.

    Angular initializes input bindings after class instantiation, so @Input values are undefined in the constructor but available in ngOnInit. Distractor A is wrong because constructors are still the correct place for dependency injection assignments, even if heavy setup logic should be avoided.

    Read the full bite: What is ngOnInit's purpose and why prefer it over the constructor?

  14. Question 14 of 30

    In Svelte 5, you declare an array with let items = $state([1, 2]) and later call items.push(3). What is the result?

    Show the answer

    Answer: c · The UI updates automatically because the array is wrapped in a reactive proxy

    In Svelte 5, the $state rune wraps arrays in proxies that intercept mutations like push, so the UI updates immediately without reassignment. Reassigning the variable to itself is a legacy pattern that is unnecessary when using runes.

    Read the full bite: How do you update Svelte arrays and objects to trigger reactivity?

  15. Question 15 of 30

    How do scoped styles in a Vue Single-File Component prevent leaking styles to neighboring components?

    Show the answer

    Answer: b · By appending a unique data attribute to both the CSS selectors and DOM elements

    Vue rewrites selectors by appending a unique data-v-hash to both the CSS and DOM elements, which isolates styles without Shadow DOM. Distractor A is wrong because scoped styles do not create perfect Shadow DOM isolation, and a parent can still style a child component's root element.

    Read the full bite: What attribute scopes styles to a Vue component?

  16. Question 16 of 30

    What mechanism does Angular use by default to prevent a component's styles from affecting other components?

    Show the answer

    Answer: d · It generates a unique HTML attribute and rewrites the component's CSS selectors to include it.

    Angular's default Emulated mode generates a unique HTML attribute for each component instance, applies it to every element in the template, and rewrites the component's CSS selectors to target that attribute. Distractor A is wrong because native Shadow DOM is only used when explicitly configured with ViewEncapsulation.ShadowDom, not by default.

    Read the full bite: What is Angular's default style encapsulation mechanism called?

  17. Question 17 of 30

    What transformation does Svelte apply to a component's styles at compile time to keep them isolated?

    Show the answer

    Answer: a · It appends a unique hashed attribute to every element and rewrites each CSS selector to include it.

    Svelte's compiler adds a unique scoped attribute to each element in the template and rewrites the CSS selectors to target only elements with that attribute, which happens entirely at build time with no runtime scoping code. Distractor A is wrong because Svelte deliberately leaves zero runtime scoping logic in the output, unlike runtime CSS-in-JS solutions.

    Read the full bite: How does Svelte scope component styles during compilation?

  18. Question 18 of 30

    Under the hood, what does v-model on a native checkbox compile into?

    Show the answer

    Answer: d · A :checked binding paired with an @change listener that updates state

    v-model is compile-time syntax sugar for prop and event pairs; for checkboxes it expands to :checked and @change. The :value/@input pair applies to text inputs, so choosing it overgeneralizes one correct pattern to a different element type.

    Read the full bite: How does Vue v-model work syntactically under the hood?

  19. Question 19 of 30

    Why are reactive forms preferred over template-driven forms for a large form with dynamically added fields?

    Show the answer

    Answer: b · They provide explicit synchronous access to FormArray and immutable model updates.

    Reactive forms use explicit synchronous models and FormArray APIs that scale for dynamic fields, whereas template-driven forms rely on implicit asynchronous directives suited for simple inputs. The most tempting distractor wrongly claims the approaches scale identically, confusing a mere syntax difference with a fundamental architectural distinction.

    Read the full bite: Key differences between Template-Driven and Reactive Forms in Angular

  20. Question 20 of 30

    In Svelte 5, how do you bind an input to reactive state and log its validity after every keystroke?

    Show the answer

    Answer: c · Use $state for the input and run validation logic inside an $effect that reads it.

    B is correct because $state creates tracked reactive state, and an $effect automatically re-runs whenever state it reads changes. C is tempting but wrong because writing to the same $state variable inside an effect that reads it creates an infinite loop.

    Read the full bite: Bind an input to a variable and validate with reactivity

  21. Question 21 of 30

    Which scenario best illustrates prop drilling creating a maintenance problem?

    Show the answer

    Answer: b · A user object is passed through Sidebar and SidebarMenu to reach Avatar, even though only Avatar consumes it.

    Prop drilling occurs when intermediaries forward props they do not themselves read or modify, inflating their API surface and making refactors risky, which option B demonstrates. Option A is incorrect because every layer actively consumes the prop, so it is normal parent-child communication rather than drilling.

    Read the full bite: What is prop drilling and when is it a problem?

  22. Question 22 of 30

    If two sibling components need to keep a value synchronized without installing a state library, where should that state live?

    Show the answer

    Answer: c · In their closest common parent, passed down via props and updated through events

    Placing the state in the closest common parent creates a single source of truth and preserves unidirectional data flow. An event bus is discouraged because it creates untraceable implicit dependencies, and localStorage breaks reactivity for transient UI state.

    Read the full bite: Share state between sibling components without a state library

  23. Question 23 of 30

    What happens when fetch is called directly inside a component template instead of inside a mount hook?

    Show the answer

    Answer: d · It triggers a new request on every render, often causing an infinite loop

    Calling fetch in a template or render function runs it on every render cycle, and because state updates trigger re-renders, this often creates an infinite loop. Option B is tempting because mounting is the desired trigger, but templates are re-evaluated on every update, not just once.

    Read the full bite: Fetch data on first render and manage loading and error states

  24. Question 24 of 30

    What do Angular's router-outlet and Vue's router-view share in purpose?

    Show the answer

    Answer: a · They act as placeholders where the matched route component is rendered

    Both elements serve as render targets where the router displays the component matched by the current URL. A tempting distractor is confusing them with the routes array, but path-to-component mapping is configured separately in app.routes.ts or src/router/index.js, not in the template outlet.

    Read the full bite: How do you define a basic Vue or Angular route?

  25. Question 25 of 30

    Which best describes how a declarative router link in an SPA template navigates to a new route while preserving client-side state?

    Show the answer

    Answer: c · It uses a framework-specific component or directive to intercept the click and push a History API state

    A router link intercepts the native click event and uses the History API to update the URL client-side, swapping matched components without requesting a new HTML document. A plain anchor tag triggers a full browser navigation because the framework does not automatically suppress the default reload behavior.

    Read the full bite: Create a template link to a route without a full page reload

  26. Question 26 of 30

    When building a useFetch composable in Vue 3, where should the data, loading, and error refs be created to guarantee each component gets its own independent state?

    Show the answer

    Answer: c · Inside the useFetch function so every call returns a fresh set of refs

    Declaring refs inside the useFetch function treats it as a factory, giving each component instance isolated reactive state. Placing them at the module level creates a singleton, causing every consumer to overwrite the same shared data.

    Read the full bite: How do you implement a data-fetching Composable in Vue 3?

  27. Question 27 of 30

    Which approach correctly creates an application-wide singleton auth service in modern Angular?

    Show the answer

    Answer: a · Decorate the service with Injectable and set providedIn to root, then inject it into components

    Using Injectable with providedIn root creates exactly one application-wide instance and enables tree-shaking. Registering the service in AppModule providers is a tempting legacy pattern that still creates a singleton but sacrifices tree-shaking and is no longer the recommended approach.

    Read the full bite: How to create a singleton Angular auth service

  28. Question 28 of 30

    Which approach correctly implements a minimal Svelte action that logs when an element is mounted?

    Show the answer

    Answer: d · Write a function that receives the DOM node, logs inside the function body, and is attached in the template with the use directive.

    A Svelte action is attached via the use directive and receives the raw DOM node to run side effects immediately upon mounting. Option C is tempting because it uses the correct directive and node argument, but it incorrectly returns a standalone cleanup function instead of an object with a destroy key.

    Read the full bite: What is a Svelte Action? Write a simple logging action.

  29. Question 29 of 30

    Which scenario best fits a computed property instead of a method in Vue?

    Show the answer

    Answer: d · Building a full name from reactive firstName and lastName fields

    Computed properties are designed for cached, derived state that depends on reactive data and does not accept arguments, making a full name the ideal fit. Filtering by a template argument is a tempting distractor because it resembles derived data, but computed getters cannot take parameters, so a method is required there.

    Read the full bite: Vue computed vs method: performance difference and when to choose each?

  30. Question 30 of 30

    What is the primary effect of configuring a route to be lazy-loaded in Vue or Angular?

    Show the answer

    Answer: a · The build tool emits a separate JavaScript chunk for the route that is fetched asynchronously when the user first navigates to it, reducing the initial bundle size.

    Lazy loading relies on dynamic imports so the bundler creates a separate chunk that is only downloaded on the first visit to that route, shrinking the initial JavaScript bundle and improving Time to Interactive. Option B is tempting but wrong because it describes eager prefetching, not lazy loading, and lazy loading can actually make the first visit to a route slightly slower due to the extra network request.

    Read the full bite: How do you lazy-load a route in Vue or Angular?

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.

Get it on Google PlayiPhone app coming soon