Learn RxJS Fundamentals#
Work through these topics in order. Each one builds on the previous, and together they give you the foundation every RxJS interview question rests on.
- Observable: the core building block. A stream of values over time, and how Angular uses it for HTTP, forms, and routing.
- Observer: the consumer side. The
next,error, andcompletecallbacks that react to a stream. - Subscription & Teardown: what
subscribe()returns, whatunsubscribe()really does, and Angular's cleanup toolbox. - The Observable Contract: the
next* (error | complete)?grammar every stream obeys, and why operators rely on it. - Cold Observables: streams that start fresh for every subscriber, like an HTTP request.
- Hot Observables: shared, live streams, like DOM events. Subscribe late and you miss earlier values.
- Unicast vs Multicast: the precise vocabulary behind cold and hot, and how sharing actually works.
- Promise vs Observable: single value vs stream, eager vs lazy, and why cancellation matters. A very common interview opener.
- Schedulers, observeOn & subscribeOn: who decides when stream code runs, and the one place it really matters: testing with virtual time. An advanced topic; safe to save for last.
After the fundamentals#
- Move on to operators to learn how streams are transformed and combined.
- Read Subjects & Multicasting to understand how one stream is shared between consumers.
- Use the comparisons for quick revision once the concepts are familiar.