Observable Fundamentals
Explain what an Observable is, how it differs from a Promise, and the producer/consumer/subscription model.
An Observable represents a stream of values over time — it can emit zero, one, or many values, synchronously or asynchronously, and can error or complete — which makes it a fundamentally more general tool than a Promise, which can only ever resolve to exactly one value (or reject once) and can't be cancelled once started. Interviewers ask about this comparison constantly because Angular leans on RxJS pervasively (HttpClient, the Router, reactive forms' valueChanges, and more all return Observables), so genuinely understanding the model — not just copy-pasting .subscribe() calls — is foundational.
A Promise is like a vending machine that dispenses exactly one snack after you press a button, and you can't get your money back once it's dispensing. An Observable is like a live radio broadcast — it can play multiple songs over time, you can tune in (subscribe) whenever you want, and you can always turn off the radio (unsubscribe) without affecting other listeners tuned into their own receivers.