Skip to content
tezvyn:

Vue, Angular & Svelte

Vue 3, Nuxt, Angular, Svelte, SvelteKit

67 bites

Test yourself: Top 30 intermediate Vue, Angular & Svelte interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate interview questions in Vue, Angular & Svelte, page 2

intermediate2 min read

How do CSS Modules differ from Vue scoped CSS?

This question tests build-time versus compiler style isolation. CSS Modules export a hashed class mapping object; Vue scoped CSS adds unique data-attributes. You bind templates via $style.myClass or an imported object. Red flag: claiming both use attributes.

How do _ngcontent and _nghost attributes enforce Angular style isolation?
intermediate2 min read

How do _ngcontent and _nghost attributes enforce Angular style isolation?

Unique component ID, _nghost on host, _ngcontent on template nodes, and CSS rewritten with attribute selectors to scope styles.

intermediate2 min read

Validate matching Vue passwords: computed property or watcher?

Use a computed boolean for caching and dependency tracking; reserve watchers for side effects only.

intermediate2 min read

How do you debounce input for API validation in Vue or Angular?

Tests reactive stream control and cancellation. A strong answer uses debounceTime at 300ms, switches with switchMap, and handles loading and error states. Red flag: using setTimeout without cleanup or ignoring race conditions.

How would you build a reusable Svelte validation action?
intermediate2 min read

How would you build a reusable Svelte validation action?

Tests Svelte action lifecycles versus inline logic. Strong answers describe a node function that attaches input or blur listeners, toggles classes or ARIA directly, returns update and destroy, and cite reusability.

intermediate2 min read

When to adopt Pinia or NgRx over simple services?

Services work for small apps; use Pinia/NgRx when state is shared across many components, mutations are complex, or debugging/undo matters.

Implement optimistic UI for a like button with rollback on failure
intermediate2 min read

Implement optimistic UI for a like button with rollback on failure

Tests state management and error recovery in async UIs. A strong answer mutates state instantly, fires the API in parallel, keeps a rollback snapshot, and reverts with a toast on failure. Red flag: waiting for the network or skipping revert logic.

How would you cache data between a list and detail view?
intermediate2 min read

How would you cache data between a list and detail view?

Use nested keys so detail reads from list cache with staleTime to skip refetches.

intermediate2 min read

How do you create a dynamic route and access the id parameter?

This tests Vue Router dynamic segment syntax and param access. Define the path with a colon like /products/:id, then read via useRoute().params.id or $route.params.id. A red flag is expecting a remount on param changes or parsing window.location manually.

intermediate2 min read

Explain navigation guards and provide an auth use case

Guards are global, per-route, or in-component hooks; returning false cancels, a route object redirects; use auth on /dashboard.

How do you configure a route for lazy loading?
intermediate2 min read

How do you configure a route for lazy loading?

Tests route-level code splitting and initial bundle control. Outline: dynamic imports in route config, on-demand chunk fetching, and measurable load-time wins versus eager loading. Red flag: treating lazy loading as just images or components, not route code.

intermediate2 min read

What are nested routes and why are they useful?

Nested routes render children inside a parent's router-view, preserving shared layouts while URL segments swap nested content.

intermediate2 min read

Would you use a Service or a custom Pipe for currency formatting?

Choose Pipe for declarative syntax; implement PipeTransform with transform(value, ...args); use Intl.NumberFormat; register standalone.

intermediate2 min read

Vue 3 Composables vs Vue 2 Mixins: differences and problems solved

Tests why Vue replaced mixins with composables for stateful logic reuse. Answers cite property collisions, unclear origin, inflexible config, and weak type inference.

How would you create a parameterized Svelte tooltip Action?
intermediate2 min read

How would you create a parameterized Svelte tooltip Action?

It tests your grasp of the Svelte Action lifecycle for reactive parameters. Answer: action takes node and parameter, returns update and destroy, bound as use:tooltip={text}. Using component events instead of the Action API, or omitting update, is a red flag.

intermediate2 min read

Architect reusable form validation in Vue vs Angular

Tests how you encapsulate reactive state across frameworks. Contrast Vue's useForm composable returning refs and lifecycle hooks. Contrast Angular's service exposing a FormGroup via RxJS.

How would you use dynamic import() to lazy-load a component-specific library?
intermediate2 min read

How would you use dynamic import() to lazy-load a component-specific library?

Tests lazy loading and bundle splitting. Good answers call import() inside the component lifecycle, await the module namespace, let the bundler split the chunk, and handle loading and error states. Bad answers put import() at top level, defeating lazy loading.

Why does an OnPush Angular child not update when its input changes?
intermediate2 min read

Why does an OnPush Angular child not update when its input changes?

Tests OnPush reference equality and manual change detection. Strong answers name: in-place object mutation as the root cause; ChangeDetectorRef.markForCheck or detectChanges to force updates; and Angular Signals as a modern path.

How does Svelte surgically update the DOM without VDOM?
intermediate2 min read

How does Svelte surgically update the DOM without VDOM?

Tests VDOM overhead vs compile-time optimization. A strong answer explains that Svelte compiles reactive dependencies into direct DOM API calls, skipping tree creation and diffing. Red flag: claiming VDOM is slow because the DOM itself is slow.

Implement virtual scrolling for a large list in Vue
intermediate2 min read

Implement virtual scrolling for a large list in Vue

Tests DOM cost awareness and viewport culling. Strong answer: mount only visible nodes plus overscan, recycle DOM on scroll, and preserve total scroll height with a spacer. Red flag: suggesting pagination or naive v-for without keys.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles