I was asked to design a rule based alert system.
Rules can be configured like below:
Apart for the system design. I gave below approach for implementing alert trigger logic.(that I could think of at that moment)
keep the rules with sorted value of price threshold.
then for each price change do a binary search to trigger all the rules above and below that point.
please suggest any better approach.