PassthroughSubject vs CurrentValueSubject?
The essence
A Subject is a Publisher you feed imperatively via send(_:); that is how delegates, callbacks and user actions get wrapped. Two built-in kinds:
PassthroughSubject— stores no value. A subscriber receives only what is sent after subscribing; anything sent earlier is lost. "Event" semantics: a tap, a notification, a command.CurrentValueSubject— holds the current value and requires an initial one ininit. A new subscriber immediately receives the current value, then the updates. Accessible via.value(read and write — writing also emits). "State" semantics: current user, loading flag.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep