Angular RxJS Interview Questions 2026, 30 Q&A on Operators and Streams
RxJS is the reactive backbone of Angular, and candidates report it is one of the most probed and most failed topics. Interviewers go past "what is an...
on this page§ 06
RxJS is the reactive backbone of Angular, and candidates report it is one of the most probed and most failed topics. Interviewers go past "what is an Observable" into the flattening operators, error handling, and memory-leak prevention. This guide compiles 30 questions from candidate-reported rounds and public preparation resources, each with code and the trade-off being tested.
The one that decides rounds: switchMap vs mergeMap vs concatMap vs exhaustMap. Get this crisp and you signal real RxJS experience.
Related: Angular Coding Interview Questions 2026 | Angular Interview Questions Freshers 2026 | JavaScript Interview Questions 2026 | TypeScript Interview Questions 2026
Observables and Subjects (Q1 to Q12)
Q1. What is an Observable?
const obs$ = new Observable<number>(sub => { sub.next(1); sub.next(2); sub.complete(); });
obs$.subscribe(v => console.log(v));
Q2. How does an Observable differ from a Promise?
| Observable | Promise | |
|---|---|---|
| Values | Many over time | One |
| Lazy | Yes (on subscribe) | Eager |
| Cancelable | Yes (unsubscribe) | No |
| Operators | Rich pipe operators | then/catch |
Q3. What is a Subject?
Q4. What are the types of Subjects?
| Subject | Behavior |
|---|---|
| Subject | No initial value, only future emissions |
| BehaviorSubject | Holds current value, emits it to new subscribers |
| ReplaySubject | Replays last N values to new subscribers |
| AsyncSubject | Emits only the last value on complete |
BehaviorSubject is the most common for state. Candidate-reported as a frequent question.
Q5. What is the difference between cold and hot observables?
Q6. What does the pipe method do?
source$.pipe(filter(x => x > 0), map(x => x * 2));
Q7. What is the difference between map and tap?
Q8. What do filter, take, and takeUntil do?
Q9. What is debounceTime and distinctUntilChanged?
Q10. What is combineLatest vs forkJoin vs zip?
| Operator | Emits |
|---|---|
| combineLatest | Latest from each source on any emission |
| forkJoin | One combined value when all complete |
| zip | Paired values by index |
forkJoin is like Promise.all; combineLatest reacts to ongoing changes.
Q11. What is startWith and scan?
Q12. How do you create observables?
Flattening Operators and Error Handling (Q13 to Q22)
Q13. Explain switchMap, mergeMap, concatMap, and exhaustMap.
| Operator | Behavior | Use case |
|---|---|---|
| switchMap | Cancels previous inner on new emission | Search/typeahead (only latest matters) |
| mergeMap | Runs all inners concurrently | Independent parallel requests |
| concatMap | Queues inners in order | Sequential writes that must not overlap |
| exhaustMap | Ignores new while one is active | Prevent double form submit |
Candidate-reported as the most important RxJS question. The interviewer wants the right operator for the scenario, not just definitions.
Q14. Which operator for a search typeahead and why?
search$.pipe(debounceTime(300), distinctUntilChanged(), switchMap(q => api.search(q)));
Q15. Which operator to prevent double form submission?
Q16. Which operator for ordered sequential writes?
Q17. How do you handle errors in RxJS?
api.get().pipe(catchError(err => of(fallbackValue)));
Q18. Why does an error stop the whole stream?
Q19. What is retry with backoff?
source$.pipe(retry({ count: 3, delay: (_, n) => timer(n * 1000) }));
Q20. What is shareReplay and when do you use it?
Q21. What is the async pipe and why prefer it?
Q22. How do you cancel an HTTP request?
Memory Leaks and Scenarios (Q23 to Q30)
Q23. What causes memory leaks in RxJS?
Q24. How do you prevent subscription leaks?
source$.pipe(takeUntilDestroyed()).subscribe(...);
Q25. Scenario: a typeahead shows stale results occasionally. Diagnose.
Q26. Scenario: an HTTP call fires multiple times for one user view. Explain.
Q27. How do you combine multiple API calls that must all succeed?
Q28. How do you implement polling with RxJS?
timer(0, 5000).pipe(switchMap(() => api.getStatus()));
Q29. Scenario: you need to retry a failed request 3 times then show an error. Code it.
api.get().pipe(
retry({ count: 3, delay: (_, n) => timer(n * 500) }),
catchError(() => of({ error: true }))
);
Q30. How do RxJS and signals coexist in 2026 Angular?
RxJS Mock Test, 2026 Edition
5 original questions calibrated to the 2026 Angular batch by Aditya Sharma, from candidate-reported patterns.
Question 1
For a search typeahead, the correct flattening operator is:
a) mergeMap b) switchMap c) concatMap d) exhaustMap
Solution: switchMap cancels the previous request, avoiding stale results. Answer: (b)
Question 2
To prevent double form submission use:
a) switchMap b) exhaustMap c) mergeMap d) concatMap
Solution: exhaustMap ignores new emissions while one is active. Answer: (b)
Question 3
A Subject that holds and emits its current value to new subscribers is:
a) Subject b) BehaviorSubject c) AsyncSubject d) ReplaySubject
Solution: BehaviorSubject carries a current value. Answer: (b)
Question 4
The idiomatic way to auto-unsubscribe in templates is:
a) ngOnDestroy only b) the async pipe c) take(1) d) shareReplay
Solution: The async pipe subscribes and cleans up automatically. Answer: (b)
Question 5
forkJoin emits:
a) on every source emission b) once when all sources complete c) paired by index d) never
Solution: forkJoin behaves like Promise.all. Answer: (b)
FAQ, Angular RxJS Interview Questions
Q: How many RxJS questions appear in a round? Candidates report three to six, almost always including the flattening-operator comparison.
Q: Do freshers get RxJS questions? Yes, observables, Subjects, and basic operators. Flattening operators and leak prevention skew mid to senior.
Q: Is RxJS being deprecated for signals? No. Signals complement RxJS; streams and HTTP still use RxJS. Confirm the stack on the official company careers page.
Q: What is the most-missed RxJS concept? Choosing the wrong flattening operator and unmanaged subscriptions, per candidate-reported feedback.
You May Also Like
Sources and review notesreviewed 8 Jun 2026
Official notices, candidate reports, offer documents, and editorial practice questions carry different confidence levels. The visible source list lets you inspect the evidence instead of relying on a blanket verification badge.
topic cluster
More resources in Interview Questions
Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.
paid contributor programme
Sat this this year? Share your story, earn ₹500.
First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story with byline.
Submit your story →ready to practice?
Take a free timed mock test
Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.