Q:

What is the key difference between Subject and ReplaySubject?

What is the difference between System.Reactive.Subjects.Subject<T> and System.Reactive.Subjects.ReplaySubject<T> classes? 
One doesn't derive from another, but they have the same description and implement same interfaces in MSDN.

A:

Take this code:
var subject = new Subject<int>();

subject.OnNext(42);
subject.OnCompleted();

subject.Subscribe(x => Console.WriteLine(x));

And compare to this:
var subject = new ReplaySubject<int>();

subject.OnNext(42);
subject.OnCompleted();

subject.Subscribe(x => Console.WriteLine(x));

The first produces no values. The second produces 42.
Basically Subject only produces values to current subscribers and ReplaySubject remembers values for future subscribes (when it "replays" the values).

