Stripe是全球领先的在线支付平台,技术牛到爆!面试除了考算法,更注重代码实用和系统设计。Stripe的OA通常有编程和算法题,时间紧,难度适中,考察你解决实际问题的能力。想拿offer?备考要懂技巧,刷题得有重点。本文帮你梳理Stripe OA全流程+高频真题,手把手教你高效备考,冲击大厂offer不是梦!

There are 2 Stripe questions, And you can find other Stripe interview questions on 1point3acres
Stripe OA 2025 Problem 1: Card Range Obfuscation
Payment card numbers consist of 8 to 19 digits, with the first six digits referred to as the Bank Identification Number (BIN). Stripe’s card metadata API provides information about different card brands within each BIN range by returning mappings of card intervals to brands.
However, a given BIN range might have gaps (at the beginning, middle, or end), where no valid card numbers are present. Fraudsters may exploit these gaps to test for valid card numbers, leading to a high probability of fraud. To prevent this, the missing intervals need to be filled, ensuring the entire range is covered.
Terminology:
- BIN Range: Refers to all 16-digit card numbers starting with a specific BIN. For example, a BIN of
424242
represents the range from4242420000000000
to4242429999999999
(inclusive). - Interval: A subset of the BIN range, inclusive of its start and end values.
Goal:
- Given a 6-digit BIN and a list of intervals corresponding to brands within the BIN range, output a sorted list of intervals that cover the entire BIN range, filling in any gaps.
- For example, for a BIN of
424242
, the task is to cover the range4242420000000000
to4242429999999999
.
解题思路
这道题目本质上是一个“区间补全”的问题,需要将一个给定范围(BIN范围)中的缺失区间补全,使得最终的区间列表完全覆盖整个BIN范围。
首先需要确定完整范围:BIN范围的起始值和结束值固定
计算:BIN起始值:BIN * 10^12(如 424242 * 10^12)
BIN结束值:BIN * 10^12 + 10^12 - 1(如 424242 * 10^12 + 10^12 - 1)
之后对输入区间排序:按照区间的起始值升序排序
合并区间:遍历排序后的区间列表,合并有交集或相邻的区间,形成一个“有效区间列表”。
补全缺失区间:遍历合并后的区间,检查每两个相邻区间之间是否有间隙。如果有间隙,则创建一个新的区间进行补全。
时间复杂度:O(NlogN)
Stripe OA 2025 Problem 2: Fraudulent Merchant Detection
A model has been deployed in production, but now complaints are being received from large users such as Ticketmaster and Amazon. These users perform a large number of transactions, and some are being incorrectly flagged as fraudulent, despite most of their transactions being legitimate. The current fraud detection threshold is too strict.
Task:
Develop a new algorithm using the percentage of fraudulent transactions (a value between 0
and 1
, inclusive) as the threshold. If a merchant’s fraud percentage reaches or exceeds this threshold, the merchant will be marked as fraudulent. Once marked as fraudulent, they will remain fraudulent even if their percentage drops with more transactions.
Additionally, the algorithm will require a minimum number of transactions for a merchant to be evaluated.
解题思路
- 记录商户的状态:
- 为每个商户维护一个状态变量,用于标记该商户是否被认为是欺诈商户。
- 状态一旦设定为欺诈商户,则不会被撤销。
- 欺诈率计算:
- 商户的欺诈率计算公式: 欺诈率 = 欺诈交易数量 / 总交易数量
- 每次有新的交易发生时,更新欺诈交易数量和总交易数量,并重新计算欺诈率。
- 检查评估条件:
- 每次更新后,检查商户是否达到最低交易数量。
- 如果达到最低交易数量并且当前欺诈率超过阈值,则标记为欺诈商户。
- 实现逻辑:
- 记录所有商户的交易数据,包括总交易数、欺诈交易数以及当前状态(是否被标记为欺诈商户)。
- 每次处理新交易时,根据交易的合法性更新商户的交易数据并重新评估状态。
Reference
We provide services for writing online assessments (OA), proxy interviews, and interview assistance. For the OA writing service, we will ensure that youachieve a perfect score. Contact us now to make an appointment.