const searchTerm$ = new Subject<string>(); const results$ = searchTerm$.pipe( distinctUntilChanged(), switchMap(term => this.http.get( /api/search?q=$encodeURIComponent(term) )) );
State management scaling laws (when local Signals are enough versus when to introduce Akita, NgRx, or SignalStore).
"How do you derive state from multiple signals?"
Combine trackBy with OnPush . If you don't provide trackBy in an ngFor , Angular will rebuild the entire DOM on every push. trackBy hacks the virtual DOM to reuse elements. Decoded Frontend - Angular Interview Hacking %21%21TOP%21%21
Before walking into your interview, ensure you can confidently talk about:
When they say, "Tell me about a time you fixed a performance bug."
Do not say: "I optimized an ngFor."
: Scope a service instance specifically to a component and its children.
import signal, computed, effect from '@angular/core'; // 1. Defining a writable signal const quantity = signal(1); // 2. Defining a computed signal (automatically tracks dependencies) const price = signal(10); const totalCost = computed(() => quantity() * price()); // 3. Updating a signal value quantity.set(5); // Direct overwrite quantity.update(q => q + 1); // Update based on previous value // 4. Effects for side-effects (e.g., logging or local storage sync) effect(() => console.log(`The updated total cost is: $totalCost()`); ); Use code with caution. 3. RxJS Architectural Patterns
Change detection is manually requested using ChangeDetectorRef . typescript trackBy hacks the virtual DOM to reuse elements
Explain why you should almost always use the async pipe in templates rather than subscribing in the component file, to avoid memory leaks. 3. Dependency Injection (DI) and Services
Dependency injection (DI) is Angular’s internal system for providing dependencies (services, values, etc.) to components, directives, and pipes. Each injectable service is registered with an injector, and Angular’s DI system automatically delivers the required dependencies when creating a component or service instance.
: Be able to discuss when to use Signals (local state/UI) versus RxJS (complex event orchestration/API calls). Defining a writable signal const quantity = signal(1); // 2
(Dmitriy Mezhenskiy) aimed at helping developers ace technical interviews for