Preparing your design workspace

Loading the problem and your saved attempt…

Design a Promotion Display Decision Engine

Model deterministic eligibility, prioritization, frequency caps, decisions, and UI-facing promotion contracts.

For this exercise, assume an application can show a banner, modal dialog, advertisement, or feature announcement on a named UI surface. Active promotion campaigns have a time window, priority, eligible audience and surface rules, a creative reference, and per-user daily and lifetime frequency caps.

Given immutable request context and a clock, the processor returns either one DisplayDecision or a typed no-display reason. The UI renders only the returned creative and later reports displayed, dismissed, or failed.

Cap reservation must be atomic so concurrent requests cannot exceed a limit; failed rendering releases the reservation, while a displayed impression consumes it. Campaign management, creative rendering, audience computation, and analytics warehousing are outside scope.

Design the object model, interfaces, decision interaction, persistence boundary, and safe extension points for new eligibility rules and promotion formats.