RXJS primer
Got it. Let’s build you a dual-mode RxJS + Angular interview arsenal — one version for when you’re rusty and need a fast reboot, and another for when you’re walking into a toxic interview and want to dominate the room with precision and zero tolerance for BS.
🧠 Mode 1: “I’ve Forgotten All This Shit” — RxJS + Angular Refresher
🔧 Core Concepts
Term | What It Means |
|---|---|
| A stream of values over time. Think async events, HTTP responses, etc. |
| An observable you can manually push values into. Good for multicasting. |
| Like |
| Chains operators to transform the stream. |
| You subscribe to start receiving values. You must unsubscribe to avoid leaks. |
🛠️ Common Operators
Operator | Use Case |
|---|---|
| Transform each value ( |
| Only pass values that meet a condition |
| Cancel previous inner observable when a new one comes in (e.g. HTTP) |
| Wait before emitting (e.g. search input) |
| Auto-unsubscribe when another observable emits |
| Combine multiple streams into one |
🧪 Angular Use Cases
this.http.get('/api/data').pipe(map(res => res.items));
this.form.valueChanges.pipe(debounceTime(300));
private destroy$ = new Subject(); ngOnDestroy() { this.destroy$.next(); this.destroy$.complete(); } this.stream$.pipe(takeUntil(this.destroy$)).subscribe();
🔥 Mode 2: “Hostile Interviewer, Toxic Environment” — Dominate with Precision
🧨 Popular Interview Questions + Tactical Responses
Question | Tactical Response |
|---|---|
“Do you even understand reactive programming?” | “Yes. It’s declarative async logic using streams. RxJS lets me model complex workflows cleanly — Promises can’t touch that.” |
“Why not just use Promises?” | “Because I don’t want to write spaghetti code for retries, cancellations, or event coordination. RxJS handles that with composable operators.” |
“How do you manage subscriptions?” | “I use |
“What’s the difference between | “ |
“How do you handle backpressure?” | “Depends on the context — |
🧱 Pushback Handling (When They Try to Flex)
takeUntil — we prefer manual cleanup.”switchMap because it’s confusing.”🧠 Gotchas to Mention (Shows You’re Battle-Tested)
switchMap or mergeMap.takeUntil, async pipe, or Subscription.unsubscribe().catchError inside pipe() — don’t let streams crash silently.🧨 Final Power Moves