advanced
Real-time Fraud Detection with CEP
Implement complex event processing logic for financial fraud.
📝 프롬프트 내용
Design a Complex Event Processing (CEP) query to detect potential credit card fraud in a real-time transaction stream. The logic should flag an account if: 1) Three transactions occur in different countries within 10 minutes, OR 2) A single transaction exceeds the user's average historical transaction amount by 5 standard deviations and occurs between 2 AM and 4 AM local time. Define the input event schema and the stateful windowing logic required to maintain historical aggregates efficiently.