Preparing your design workspace

Loading the problem and your saved attempt…

Design a Playlist Source Mixer

Design a request-scoped playlist mixer that combines filtered candidates from DJ and recommendation sources in an equal or custom proportion.

Design production-ready classes that build one playlist from a DJ service and a recommendation service in an equal or caller-selected custom proportion, with user-preference filters.

For this exercise, assume one caller chooses a maximum playlist length, an immutable preference filter, and a DJ percentage from 0 through 100; 50 means an equal mix. Both services expose ordered pages of candidates after applying the same filter.

Tracks have stable track IDs, duplicate IDs appear at most once, and the mixer chooses the available source that keeps accepted counts closest to the requested proportion. When both choices are equally close, prefer the DJ source. If the selected source has no unused candidate, use the other source.

Stop when the requested length is reached or both sources are exhausted. Mixing state is local to one request; playback, persistence, recommendation training, cross-request personalization, and internal ranking algorithms are outside scope.

Show the object model, interfaces, collaboration, and failure behavior. Focus on responsibility boundaries and a deterministic design rather than executable implementation code.