Angular Signals: A Beginner-Friendly Guide for Interviews
Signals changed how Angular handles state and change detection. Learn signal, computed and effect with simple examples.
Sample article
Angular
The RxJS operators Angular interviewers ask about most — when to use each flattening operator, how to avoid memory leaks, and how to handle errors without breaking a stream.
Angular uses RxJS for HTTP calls, router events and reactive forms, so interviewers expect you to know the common operators and — more importantly — when to choose one over another.
All four map each value to an inner Observable and flatten the result. They differ in what happens when a new value arrives while an inner Observable is still running.
this.results$ = this.searchControl.valueChanges.pipe(
debounceTime(300), // wait for the user to pause typing
distinctUntilChanged(), // skip if the text did not change
filter((q) => q.length >= 2),
switchMap((q) => this.api.search(q)), // cancel the previous request
);Subscriptions that outlive a component keep running and hold references in memory. The cleanest options are the async pipe, which subscribes and unsubscribes automatically, and takeUntilDestroyed() from @angular/core/rxjs-interop for subscriptions in code.
constructor() {
this.route.paramMap
.pipe(takeUntilDestroyed()) // completes when the component is destroyed
.subscribe((params) => this.load(params.get('id')));
}An error completes an Observable. If you catch it on the outer stream, a search box stops working after the first failed request. Catch it inside the inner Observable instead, and return a fallback value.
switchMap((q) =>
this.api.search(q).pipe(
catchError(() => of([])), // the outer stream keeps working
),
)shareReplay shares one subscription between multiple subscribers and replays the latest value(s) to late subscribers. It is commonly used to cache an HTTP response, such as configuration or the current user. Use shareReplay({ bufferSize: 1, refCount: true }) when the source should stop once nobody is listening.
Signals are great for synchronous UI state that templates read. Observables remain the better fit for asynchronous events over time — HTTP, WebSockets, debounced input. Angular connects them with toSignal() and toObservable(), and a strong answer explains that they complement each other.
State the behaviour you need first (cancel, parallel, queue or ignore), then name the operator. That shows you understand the concept, not just the name.
This is a sample article published as a starter resource. Verify technical details against official documentation for the versions you use.
Signals changed how Angular handles state and change detection. Learn signal, computed and effect with simple examples.
Sample article
Common microservices interview questions for Java developers — service communication, API gateways, service discovery, resilience, data management and how to explain your own architecture.
Sample article
Have an idea for an app or website? These seven things help you get accurate estimates, avoid costly changes and launch faster — even without a technical background.
Sample article
Prepare. Perform. Progress.
Our team can help you prepare, solve doubts and practise interviews around what you are learning.