tezvyn:

Vue, Angular & Svelte

Vue 3, Nuxt, Angular, Svelte, SvelteKit

307 bites

More in Vue, Angular & Svelte — page 6

Vue, Angular & Svelte2 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.

Vue, Angular & Svelte2 min read

What deep selector pierces Vue scoped styles, and why use it cautiously?

This tests Vue scoped CSS encapsulation. Use :deep() to target child internals from a scoped block, but it breaks encapsulation and creates brittle coupling. A red flag is recommending deprecated /deep/ or unscoped global styles.

Compare Angular's three ViewEncapsulation modes and give a use case.
Vue, Angular & Svelte2 min read

Compare Angular's three ViewEncapsulation modes and give a use case.

This tests style isolation tradeoffs. Emulated scopes CSS with unique attributes, ShadowDom uses native shadow roots, and None disables scoping. Switch to ShadowDom for strict boundaries or None for global themes.

How does Svelte scope component styles during compilation?
Vue, Angular & Svelte2 min read

How does Svelte scope component styles during compilation?

WHAT IT TESTS: Knowledge of Svelte's compile-time CSS encapsulation. ANSWER OUTLINE: The compiler adds a unique attribute to component elements and rewrites selectors to target it, isolating styles. RED FLAG: Claiming scoping uses runtime JS or shadow DOM.

What is Angular's default style encapsulation mechanism called?
Vue, Angular & Svelte2 min read

What is Angular's default style encapsulation mechanism called?

Tests if you know Angular's default view encapsulation. A strong answer names ViewEncapsulation.Emulated, describes the unique attribute selector rewrite, and warns that global styles still pierce inward.

Vue, Angular & Svelte2 min read

What attribute scopes styles to a Vue component?

This tests knowledge of Vue's style encapsulation. Add the scoped attribute to the style tag; Vue adds a unique data attribute to elements and selectors. A red flag is suggesting manual BEM or claiming scoped styles never affect child components.

Vue, Angular & Svelte2 min read

Implement auto-cleanup reactive logic in Vue's Composition API and Svelte

WHAT IT TESTS: Binding streams to lifecycles without leaks. ANSWER OUTLINE: Vue pairs onMounted with onUnmounted or watchEffect cleanup; Svelte uses $store auto-subscription or onDestroy.

How do Svelte Stores work and how do you create custom ones?
Vue, Angular & Svelte2 min read

How do Svelte Stores work and how do you create custom ones?

Tests Svelte store contract mastery. A strong answer defines the subscribe/unsubscribe interface, wraps writable() with custom set/update logic, subscribes via $ prefix or manually, and uses $store in templates.

Vue, Angular & Svelte2 min read

Fundamental difference between Vue computed and watcher with examples

Tests derived state vs side effects in Vue reactivity. Computed returns cached derived value; watch executes callback on mutation. Example: computed filters list; watch fetches data when ID changes. Red flag: watch for template state or computed for async.

Explain Angular default change detection, zone.js, and OnPush
Vue, Angular & Svelte2 min read

Explain Angular default change detection, zone.js, and OnPush

Deep knowledge of Angular's automatic vs explicit change detection. Explain zone.js monkey-patching async APIs to trigger default checks; contrast with OnPush requiring immutable inputs, async pipe, or markForCheck.

How do you update Svelte arrays and objects to trigger reactivity?
Vue, Angular & Svelte2 min read

How do you update Svelte arrays and objects to trigger reactivity?

This tests knowledge of Svelte 5 deep reactivity: $state wraps arrays in proxies so push and property mutations trigger updates. Mention $state first, then note legacy syntax needs reassignment. A red flag is claiming push never works in Svelte.

What is ngOnInit's purpose and why prefer it over the constructor?
Vue, Angular & Svelte2 min read

What is ngOnInit's purpose and why prefer it over the constructor?

Tests Angular lifecycle timing and input binding. Strong answer: ngOnInit runs once after inputs are initialized, but the constructor instantiates the class before bindings exist.

Vue, Angular & Svelte2 min read

Vue 3 ref() vs reactive(): differences and when to use each

Tests Vue 3 Composition API reactivity primitives. Strong answer: ref() wraps any value in a .value wrapper and is the recommended default; reactive() returns a proxy accessed directly. Red flag: saying ref() is only for primitives or omitting .value entirely.

How would you create a custom *appDelay structural directive?
Vue, Angular & Svelte2 min read

How would you create a custom *appDelay structural directive?

This tests Angular rendering internals. A strong answer covers: TemplateRef as the embedded template, ViewContainerRef as insertion anchor, and a setter that creates the embedded view after a delay. Mention OnDestroy cleanup.

Vue, Angular & Svelte2 min read

In Vue 3, what problem does Teleport solve?

This tests DOM hierarchy and CSS stacking context. A strong answer covers how Teleport moves markup to a target like body to escape ancestor transforms and z-index ceilings trapping fixed modals. Red flag: claiming it is only for cleaner HTML.

How does Angular OnPush change detection affect rendering?
Vue, Angular & Svelte2 min read

How does Angular OnPush change detection affect rendering?

This tests change detection tree knowledge. OnPush skips checks unless inputs change by reference, events fire, or async pipes mark for check. Mutated objects or manual subscriptions without markForCheck cause silent misses.

What's the difference between Angular property and attribute binding?
Vue, Angular & Svelte2 min read

What's the difference between Angular property and attribute binding?

Tests whether you know Angular binds to DOM properties by default. [disabled] sets a DOM property; [attr.role] sets an HTML attribute. Use attribute binding when no DOM property exists, such as SVG attributes or role. Red flag: claiming they are equivalent.

Why does todos.push miss Svelte updates but spread works?
Vue, Angular & Svelte2 min read

Why does todos.push miss Svelte updates but spread works?

Tests compile-time versus runtime reactivity. Answer: Svelte's compiler instruments assignments, not method calls, so push is invisible; Vue Proxies and Angular Zone.js both intercept push to trigger updates.

Vue, Angular & Svelte2 min read

How do you pass markup from a parent to a child component?

This tests declarative composition for UI reuse. A strong answer covers default and named slot syntax in Vue/Svelte (slot outlet, v-slot) or Angular ng-content with select for named projection.

Vue, Angular & Svelte2 min read

Explain key or trackBy in list rendering and index key risks

WHAT IT TESTS: Your understanding of virtual DOM reconciliation and stable element identity. A good answer covers that key binds DOM state to data identity, and that index keys break reordering by recycling wrong components.