How to Pass Stripe SWE OA | Real Coding Challenges

Stripe is a leading fintech company known for its developer-first culture and engineering excellence. Stripe SWE OA reflects this philosophy —instead of generic puzzles, Stripe’s OA often focuses on clean code, real-world abstractions, and systemic problem-solving. If you’re preparing for a Stripe SWE intern or new grad position, expect practical coding questions with an emphasis on correctness, designclarity, and maintainability.

Here are three representative problems that reflect the style of questions commonly seen in Stripe’s OA, along with clean solutions.

Stripe SWE OA

Parsing and Evaluating Stripe Transaction Logs

Prompt:
You are given a list of transaction logs from Stripe’s payment system. Each log is a string in the format:

"{user_id} {event_type} {amount}"
  • event_type can be "credit" or "debit"
  • amount is an integer
  • Calculate the final balance for each user.

Input:

logs = [
    "alice credit 100",
    "bob debit 50",
    "alice debit 30",
    "bob credit 20"
]

Stripe Email Verification System

Prompt:
Implement a function to check if two email addresses are equivalent under Stripe’s email normalization rules:

  • Ignore . in the local name (before @)
  • Ignore anything after + in the local name

Input:

email1 = "stripe.test+payments@gmail.com"
email2 = "stripetest@gmail.com"

Expected Output: True

Python Solution:

def normalize(email):
    local, domain = email.split('@')
    local = local.split('+')[0].replace('.', '')
    return f"{local}@{domain}"

def are_same_email(e1, e2):
    return normalize(e1) == normalize(e2)

Stripe Rate Limiter Simulation (Sliding Window)

Prompt:
You are simulating Stripe’s API rate limiting logic. Implement a simple sliding window limiter that checks if a user can make a request at agiven time based on these rules:

  • A user can only make up to 3 requests per 10-second window

Input Example:

requests = [1, 2, 3, 11, 12] # seconds

Output:
[True, True, True, True, True]

Explanation:
Requests at 1, 2, 3 are accepted; next request at 11 is in a new 10-sec window.

Python Solution:

from collections import deque

def rate_limiter(requests, window_size=10, max_requests=3):
    q = deque()
    results = []
    for t in requests:
        while q and q[0] <= t - window_size:
            q.popleft()
        if len(q) < max_requests:
            q.append(t)
            results.append(True)
        else:
            results.append(False)
    return results

Need help preparing for Stripe OA or technical interviews?

Programhelp offers tailored coaching, mock interviews, and live technical support to help you land offers from top companies like Stripe, Meta, Citadel, and more.

author avatar
azn7u2@gmail.com
END
 0
Comment(尚無留言)