Why did subscribing twice trigger two HTTP requests in Angular?

Angular forms & HTTPTechnical deep diveAbout 12 minutes

Understand the idea, explain it in your own words and use the rubric to find your next learning gap.

Local drafts · no account or AI calls
Sukoaa original

The idea behind the question

HttpClient observables are cold: subscribing starts work. Sharing or caching can avoid repeated work, but requires decisions about subscribers, cancellation, invalidation and the lifetime of retained data.

AN ILLUSTRATIVE EXAMPLE

Two view regions subscribe to the same unshared request observable and each starts a separate network request.

A practical way to learn it

Use Angular HTTP testing to observe two subscriptions, then implement a documented sharing policy and verify both duplicate suppression and explicit invalidation.

Open Angular project studio

The related tool opens separately; your interview answer stays here. Written practice is self-guided, without automatic code grading.

Build an explanation you understand

  1. State what the concept does in plain language.
  2. Apply it to the example and make your assumptions explicit.
  3. Explain a trade-off, failure case and how you would test it.
  4. Distinguish your actual experience from a proposed approach.

Further reading

Further-reading links support learning; the reference is Sukoaa-authored, not an official employer answer key.