Stripe logo

Stripe Interview Questions

22 practice questions for Stripe technical interviews

coding Hard Verified

Filter Roles


Category: Tree coding problem
You are building a role-based access control (RBAC) system for a multi-tenant platform. The system manages user roles across a hierarchical account...
Input: List
Output: Array
coding Hard Verified

Rate Limiter


Category: Sliding window coding problem
Design a rate limiter that tracks API requests per client and enforces limits using a sliding time window. Your system must support: - hit(key,...
Input: Given input
Output:** Computed result
coding Medium Verified

Shipping Cost Calculator


Category: Algorithm coding problem
You are building a shipping cost calculator for an international e-commerce platform. The cost depends on the destination country and the product...
Input: Integer(s)
Output: Computed result
coding Medium Verified

Transaction Fee Calculator


Category: Trie-based coding problem
You are building a fee calculation system for a payment processing platform. Given transaction data as a CSV string, calculate fees based on payment...
Input: String
Output: Computed result
coding Medium Verified

Bitmap to Image Conversion


Category: Grid/matrix coding problem
You are designing a bitmap character rendering system. Given a lookup table mapping characters to 2D binary arrays, implement functionality to print,...
Input: 2D grid
Output: Printed output
coding Medium Verified

[Onsite Integration] Bike Map


Category: Trie-based coding problem
You are building a map visualization tool that generates static maps from location data. Implement a system that reads GPS coordinates, constructs...
Input: Array
Output: Computed result
coding Hard Verified

Email Subscriptions


Category: String coding problem
Design a subscription management system that tracks user subscriptions and sends automated emails at specific lifecycle events. Email Types: -...
Input: List
Output: Computed result
coding Hard Verified

[Bug Squash] Mako Template Engine


Category: Tree coding problem
In this bug squash round, you will find and fix errors in a Python template library. You will receive a link to a GitHub folder containing a version...
Input: List
Output: Printed output
coding Hard Verified

[Bug Squash] Moshi JSON Library


Category: String coding problem
In this bug squash round, you will find and fix mistakes in a Java library called Moshi. You will receive a link to a GitHub folder containing a...
Input: String
Output: Computed result
coding Hard Verified

Data Center Load Scorer


Category: Graph coding problem
A data center operations team monitors server energy usage to optimize resource allocation. You receive a daily dataset of all incoming requests to...
Input: Graph (nodes and edges)
Output: Array
coding Medium Verified

Content Validation Pipeline


Category: String coding problem
A platform ingests user-generated content records in a simplified CSV format. Before indexing or displaying any content, each record must pass a...
Input: Array of strings
Output: Array
coding Hard Verified

Wallet Transaction Ledger


Category: String coding problem
A fintech platform processes streams of wallet transactions and needs to consolidate them into account summaries. Each transaction is logged as a...
Input: List
Output: Computed result
coding Hard Verified

Employee Record Matcher


Category: Array coding problem
A data-quality team needs to detect duplicate or near-duplicate employee records in a large HR dataset. Each record is a row in a 2D string array...
Input: Array
Output: Array
coding Hard Verified

Candidate Tech Stack Filter


Category: String coding problem
A hiring platform screens candidates by comparing their declared technology stack against a job's required skills. A candidate submits a...
Input: Array of strings
Output: Array
coding Hard Verified

Subscriber Notification Planner


Category: Trie-based coding problem
A subscription service sends automated notifications to subscribers based on their subscription window. You are given a list of subscriber records...
Input: List
Output: Array
coding Medium Verified

Support Ticket Dispatcher


Category: Graph coding problem
A customer support platform assigns incoming tickets to agents to keep workloads balanced. You are given a list of agent names and a list of tickets...
Input: Graph (nodes and edges)
Output: Array
coding Medium Verified

Order Payment Reconciler


Category: String coding problem
A billing system needs to match incoming payments to open orders. Each payment arrives as a comma-separated string with three fields: a payment ID, a...
Input: List
Output: Computed result
coding Medium Verified

Service Usage Cost Calculator


Category: Array coding problem
A cloud billing module computes the total cost for a customer's monthly usage. You are given a usage_report specifying the target region and...
Input: Array
Output: Computed result
system design Senior api design

[OA] API Design — Create a payment processing API for Stripe

Stripe needs a robust payment processing API that can handle a variety of transaction types, while ensuring security, reliability, and scalability.
Problem statement: Design a RESTful API for processing payments, with endpoints for creating charges, retrieving payment status, and listing transactions.
- POST /charges: Creates a new charge.
- GET /charges/{chargeId}: Retrieves the status of a specific charge.
- GET /charges: Lists all transactions based on pagination parameters.
Example 1:
Input: POST /charges with body {amount: 1000, currency: 'usd', source: 'tok_visa'}
Output: 201 Created with body {id: 'ch_1FZh2I2eZvKYlo2C4H2gGm7', status: 'succeeded'}
Example 2:
Input: GET /charges/ch_1FZh2I2eZvKYlo2C4H2gGm7
Output: 200 OK with body {id: 'ch_1FZh2I2eZvKYlo2C4H2gGm7', status: 'succeeded'}
Constraints:
- Each charge has a unique chargeId, an amount in cents, and a currency string, e.g., 'usd'.
system design Senior caching

[OA] LRU Cache — Implement a caching mechanism for Stripe API responses

To optimize the performance of API calls, Stripe needs an efficient caching layer that stores the most requested API responses based on a least recently used (LRU) algorithm.
Problem statement: Design and implement an LRU cache with methods to get a cached value and to put a value into the cache.
- get(key: int): int: Retrieves the value of the key if the key exists in the cache, otherwise returns -1.
- put(key: int, value: int): void: Updates the value of the key if the key exists, and if the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.
Example 1:
Input: put(1, 1)
Output: None
Input: put(2, 2)
Output: None
Input: get(1)
Output: 1
Input: put(3, 3)
Output: None
Input: get(2)
Output: -1
Constraints:
- cache capacity is a positive integer.
- 1 <= key, value <= 10^4.
coding Hard tree

[OA] Tree — Implement Stripe's payment transaction history

To improve user experience, Stripe needs a data structure to represent users' transaction histories in a way that allows for efficient retrieval and management.
Problem statement: Design a transaction history structure where each transaction has an int transactionId, double amount, string date, and nested transactions. Implement methods to add a transaction and to retrieve the transaction with the highest amount.
- addTransaction(transactionId: int, amount: double, date: string): void: Add a transaction to the history.
- getMaxTransaction(): (int, double, string): Returns the ID, amount, and date of the transaction with the highest amount.
Example 1:
Input: addTransaction(1, 100.50, '2023-03-01')
Output: None
Example 2:
Input: addTransaction(2, 200.75, '2023-03-02')
Output: None
Input: getMaxTransaction()
Output: (2, 200.75, '2023-03-02')
Constraints:
- 1 <= transactionId <= 10^6
- 0 <= amount <= 10^6
- date follows the format 'YYYY-MM-DD'.
coding Hard sliding window

[OA] Sliding Window — Implement a rate-limiting service for Stripe API

In order to protect our APIs from abuse and to ensure fair usage, Stripe requires a sliding window rate limiter that tracks the number of requests for each API key over a given time period.
Problem statement: You need to implement a rate limiter that allows a specified number of requests per minute (e.g., 100 requests) for each unique string apiKey. Ensure that the rate limiter has a method to track requests and should return a boolean indicating whether the request is allowed.
- trackRequest(apiKey: string): boolean: Returns true if the request is allowed, false otherwise.
Example 1:
Input: trackRequest('key1')
Output: true
Explanation: The request is allowed.
Example 2:
Input: trackRequest('key1') (100 times)
Output: true (first 100 calls)
Output: false (101st call)
Constraints:
- 1 <= apiKey.length <= 100
- Rate limit can be bursty but should not exceed specified limits.
- Simulate up to 10^6 requests.

Start practicing Stripe questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free