Skip to main content

Explain Hot Observable vs Cold Observable.

Expert Angular
Quick Answer Cold observable: each subscriber creates a new independent execution. HTTP calls are cold - every subscribe makes a new request. Hot observable: single execution, all subscribers share it. Mouse events are hot - event happens regardless of subscribers. The distinction matters for avoiding duplicate HTTP calls: use shareReplay(1) to make a cold Observable hot and cache the result.

Answer

Cold Observables start producing values only when subscribed. Each subscriber gets its own execution (e.g., HTTP calls).

Hot Observables emit values regardless of subscriptions. Subscribers join an active stream (e.g., events, websockets).

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice