InterviewDB Experience

Subscription and Subject Class - Implement an Observable/Observer Pattern

Interview Experience

Problem Implement a Subject class (observable) and a Subscription class (observer handle) following the observer pattern. Multiple observers can subscribe to a subject; each receives emitted values. Subscribers can unsubscribe at any time. Example: Additional requirement: After complete() or error() is called, subsequent next() calls are no-ops and new subscribers immediately receive the terminal event. Follow-ups How would you add back-pressure support if the subscriber is slower than the produ…

Full Details

🔒

Unlock all Grammarly questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a grammarly interview during the onsite round.

It covers the following topics: Coding, Onsite .