Company: Rippling
Difficulty: medium
Problem Description A company issues corporate credit cards to its employees so that they can pay for business expenses. Managers configure a rules engine on top of those cards so that employees cannot misuse a card or exceed the allowances they were given. Every card transaction is recorded as an expense . Each expense belongs to exactly one trip and stores an expense type, a vendor type, a vendor name and an amount. You are given the list of rules that are currently active and the list of recorded expenses. Your task is to run the rules engine and report: every expense that violates at least one per-expense rule, and every trip that violates at least one trip-level rule. Rule Types Per-expense rules. An expense that matches such a rule is flagged. BAN_EXPENSE_TYPE t — an expense whose expense type equals t is not allowed. BAN_VENDOR_TYPE v — an expense whose vendor type equals v is not allowed. BAN_VENDOR_NAME n — an expense whose vendor name equals n is not allowed