Process auth requests with fraud rules

Quick Overview

This question evaluates a candidate's ability to implement stateful stream processing and event handling, including applying time-scoped fraud rules to authorization requests, maintaining chronological ordering, and producing verified outputs via unit tests.

Process auth requests with fraud rules

Company: Stripe

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

##### Question Implement a function that, given a list of Authorization Requests (timestamp_seconds, unique_id, amount, card_number, merchant), outputs a human-readable report ordered chronologically, with each line formatted as "timestamp unique_id amount APPROVE". Extend the function to also consume a stream of Fraud Rules (time, field, value). From the rule’s time onward, any future Authorization Request whose specified field equals the rule’s value must be marked fraudulent. Produce the same report, but with "REJECT" for fraudulent requests and "APPROVE" otherwise. Include unit tests demonstrating correctness.

Quick Answer: This question evaluates a candidate's ability to implement stateful stream processing and event handling, including applying time-scoped fraud rules to authorization requests, maintaining chronological ordering, and producing verified outputs via unit tests.

|Home/Coding & Algorithms/Stripe
Stripe logo
Stripe
Jul 29, 2025, 8:05 AM
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
63
0
Question

Implement a function that, given a list of Authorization Requests (timestamp_seconds, unique_id, amount, card_number, merchant), outputs a human-readable report ordered chronologically, with each line formatted as "timestamp unique_id amount APPROVE".

Extend the function to also consume a stream of Fraud Rules (time, field, value). From the rule’s time onward, any future Authorization Request whose specified field equals the rule’s value must be marked fraudulent. Produce the same report, but with "REJECT" for fraudulent requests and "APPROVE" otherwise. Include unit tests demonstrating correctness.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...