Design a Business Rule Engine
Design a rule engine for evaluating business rules. Include rule definition with conditions and actions, rule sets with priority ordering, a shared fact base, and conflict resolution strategies.
Suggested time: 45 minutes
Loading the workspace...
About this problem
A business rule engine separates decision logic from application code. Instead of hardcoding "if customer age > 65, apply senior discount" in your service, you externalize it as a Rule that business analysts can modify without deploying code. The challenge is evaluating complex composite conditions against shared mutable facts while supporting forward chaining.
What your design needs to cover
Define Rules as Condition-Action Pairs
Evaluate Rules Against Facts
Rule Priority and Conflict Resolution
Group Rules into RuleSets
Key challenges the editorial covers
Learn from other designs
Related problems
Design a Workflow Engine (hard)
Design a Plugin System (hard)
Design a Music Streaming App (hard)