ORIGINAL COMPANY-CONTEXT PRACTICE
Resolve streaming entitlement updates
Original practice scenario inspired by The Walt Disney Company's public business context; this is not a reported interview question or a description of its internal systems. A synthetic streaming app receives subscription events such as renewal, cancellation, and correction. Messages arrive out of order. Explain a state reducer that determines entitlement without letting an older event undo a newer correction.
Written for independent practice using company context; this is not a verified question from a company interview.
A REASONED APPROACH
Model answer.
Use explicit event identity and a documented ordering or version rule. Event arrival order is unreliable, and cancellation can mean either immediate revocation or access until a paid-through date.
Work through it
- Define event semantics, effective timestamps, and authoritative subscription versions. Validate that every event belongs to the correct account and subscription.
- Deduplicate event IDs and apply only valid transitions. Keep paid-through time distinct from current status, and record contradictions for reconciliation with the subscription authority.
- Test renewal followed by a late cancellation, equal-version conflicts, duplicate corrections, and exact expiry boundaries. Replaying events in different delivery orders should yield the same authoritative state.
Tradeoffs to discuss
- A reducer based on monotonic versions is simple, but some event sources require a reconciliation snapshot. Preserve enough history to explain the selected state.
Common pitfalls
- Sorting solely by receipt time makes replay unstable.
- A generic canceled flag can revoke paid access early or retain access after an immediate security revocation.