Stripe logo

Stripe Interview Questions

49 practice questions for Stripe technical interviews

Stripe software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Hard Verified Question #1

1. 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 Question #2

2. 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 Question #3

3. 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 Question #4

4. 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 Question #5

5. 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 Question #6

6. [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 Question #7

7. 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 Question #8

8. [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 Question #9

9. [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 Question #10

10. 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 Question #11

11. 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 Question #12

12. 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 Question #13

13. 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 Question #14

14. 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 Question #15

15. 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 Question #16

16. 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 Question #17

17. 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 Question #18

18. 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
coding Medium graph #1

1. Graph — Find the shortest transaction path


Background: In Stripe's payment processing system, understanding transaction flows is crucial for identifying bottlenecks and optimizing performance. This problem is related to ensuring that transaction paths are efficient.
Problem statement: You are given a directed graph where each node represents a transaction, and an edge from A to B indicates that transaction A directly leads to transaction B. Write a function that finds the shortest path from a given start transaction to an end transaction. Return the path as a list of transactions. If there is no path, return an empty list.
Function/class signature:
  • def find_shortest_transaction_path(transactions: List[Tuple[str, str]], start: str, end: str) -> List[str]:


Example 1:
  • Input: transactions = [("A", "B"), ("B", "C"), ("A", "C")], start = "A", end = "C"

  • Output: ['A', 'C']

  • Explanation: The direct path from A to C has the shortest length.


Example 2:
  • Input: transactions = [("A", "B"), ("B", "C"), ("C", "A")], start = "A", end = "D"

  • Output: []

  • Explanation: There is no transaction D present.


Constraints:
  • The number of transactions will not exceed 1000.

  • Each transaction is represented as a unique string.
coding Medium hash map #2

2. [Hash_map] — Find unprocessed payments from a list

Background: Stripe processes millions of transactions daily. Occasionally, payments may not be fully completed due to various issues (e.g., network failures, user cancellations). Identifying unprocessed payments quickly can help improve user experience and operational efficiency.
Problem statement: You are given a list of payment IDs. Some payments are successfully processed, while others remain unprocessed, indicated by their accompanying status (either processed or unprocessed). Create a function that returns all payment IDs that are unprocessed.
Function/class signature:
  • def find_unprocessed_payments(payment_list: List[Tuple[str, str]]) -> List[str]:


Example 1:
Input: payment_list = [('abc123', 'processed'), ('xyz789', 'unprocessed'), ('qwe456', 'processed')]
Output: ['xyz789']
Explanation: Only the payment with ID xyz789 is unprocessed.
Example 2:
Input: payment_list = [('p1', 'unprocessed'), ('p2', 'unprocessed'), ('p3', 'processed')]
Output: ['p1', 'p2']
Explanation: Both payments p1 and p2 are classified as unprocessed.
Constraints:
  • The length of payment_list can be between 1 and 10^5.

  • Each payment ID is a string of up to 100 characters.

  • Each status is guaranteed to be either processed or unprocessed.

coding Hard tree #3

3. [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 #4

4. [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.
system design Medium api design #5

5. Design PaymentProcessor — a class to handle payment processing


Background: Stripe is a payment processing platform that requires efficient handling of various payment methods to support business transactions. The PaymentProcessor class will manage different types of payments, ensuring they can be processed securely and reliably.
Requirements:
1. The class must support initiating transactions with different payment methods (e.g., credit card, bank transfer).
2. It must implement methods to handle transaction approvals and declines.
3. The processor should maintain a log of all transactions.
4. Implement a method to retrieve transaction details using a unique transaction ID.
5. Ensure that all methods handle concurrency appropriately.
Class API:
  • initiate_payment(payment_method: str, amount: float) -> str

- Initiates a payment and returns a transaction ID.
  • approve_transaction(transaction_id: str) -> bool

- Approves the transaction and returns success status.
  • decline_transaction(transaction_id: str) -> bool

- Declines the transaction and returns success status.
  • get_transaction(transaction_id: str) -> dict

- Returns the transaction details for the given ID.
Example 1:
Input:
  • initiate_payment('credit_card', 100.00) → Output: transaction_id: 'txn_12345'

Explanation: The payment is initiated successfully, returning a unique transaction ID.
Example 2:
Input:
  • approve_transaction('txn_12345') → Output: True

Explanation: The transaction is approved.
Constraints:
  • Maximum of 1000 transactions in memory at any one time.

  • Methods must be thread-safe to handle concurrent requests.
system design Medium distributed systems #6

6. System Design: Design a Load Balancer

Background: Stripe handles high volumes of payment transactions, necessitating an effective distribution of incoming traffic to ensure reliability and performance. Designing a load balancer helps manage requests efficiently across multiple servers.
Requirements:
1. Support for multiple instances of back-end servers to distribute traffic.
2. Health checks to monitor the status of the servers.
3. Algorithms for load distribution (e.g., round-robin, least connections).
4. Ability to handle sticky sessions when required.
5. Logging functionality for monitoring and analytics.
Class API:
  • def add_server(self, server: str) -> None:

Adds a new server to the load balancer.
  • def remove_server(self, server: str) -> None:

Removes a server from the load balancer.
  • def get_next_server(self) -> str:

Returns the next server to which a request should be directed.
  • def health_check(self) -> List[str]:

Returns a list of healthy servers.
  • def log_request(self, server: str) -> None:

Logs a request sent to a server for analytics.
Example 1:
Input:
load_balancer = LoadBalancer()  
load_balancer.add_server("server1")  
load_balancer.add_server("server2")  
load_balancer.get_next_server()

Output:
"server1"
Explanation:
The load balancer routes to server1 on the first call.
Example 2:
Input:
load_balancer.add_server("server3")  
load_balancer.get_next_server()  
load_balancer.get_next_server()

Output:
"server2"
Explanation:
After server1, the next in line is server2 followed by server3.
Constraints:
  • Maximum of 100 servers can be added.

  • Health checks should occur every 10 seconds.

  • Must support up to 1000 simultaneous requests.
system design Medium api design #7

7. [System Design] — Design a TransactionProcessor that simulates transaction handling for Stripe

Background: Stripe processes millions of transactions every day and needs an efficient system to handle various types of transactions reliably. This class will simulate the processing of these transactions in a way that can be used for both testing new features and validating current functionality.
Requirements:
1. process_transaction(transaction_id: str, amount: float) - Processes a transaction and updates internal state.
2. get_transaction_status(transaction_id: str) - Retrieves the status of a specific transaction.
3. refund_transaction(transaction_id: str) - Issues a refund for a completed transaction and updates the status.
4. Internal mechanisms to track successful, failed, and refunded transactions.
5. Ensure thread-safe operation when processing transactions concurrently.
Class API:
  • process_transaction(transaction_id: str, amount: float) -> None - Processes the transaction identified by transaction_id with the specified amount.

  • get_transaction_status(transaction_id: str) -> str - Returns the status of the specified transaction.

  • refund_transaction(transaction_id: str) -> bool - Refunds the transaction and returns True if successful, False otherwise.

Example 1:
Input: tp = TransactionProcessor()
Sequence:
tp.process_transaction('txn_001', 100.0)
tp.get_transaction_status('txn_001') → Output: 'successful'
Explanation: The transaction is processed and marked as successful.
Example 2:
Input: tp = TransactionProcessor()
Sequence:
tp.process_transaction('txn_002', 50.0)
tp.refund_transaction('txn_002')
tp.get_transaction_status('txn_002') → Output: 'refunded'
Explanation: The transaction is processed and subsequently refunded.
Constraints:
  • Maximum 100,000 transactions can be processed.

  • All transaction IDs are unique strings.

  • Operation must handle concurrent processing without data corruption.
system design Medium api design #8

8. Design CampaignManager — A class to manage marketing campaigns for Stripe

Background: Stripe runs numerous marketing campaigns to attract new customers and retain existing ones. A robust system is necessary to organize, track, and analyze the effectiveness of these campaigns. This helps in optimizing marketing strategies and ensuring a good return on investment.
Requirements:
1. Ability to create a new campaign with a unique identifier.
2. Track the status of the campaign (active, paused, completed).
3. Fetch all campaigns within a specified date range.
4. Calculate total spend and returns for a particular campaign.
5. List all campaigns with a specific status.
6. Allow pausing and resuming campaigns.
Class API:
  • def create_campaign(id: str, name: str, budget: float, start_date: str, end_date: str) -> None: Creates a new campaign.

  • def update_campaign_status(id: str, status: str) -> None: Updates the status of the campaign.

  • def fetch_campaigns(start_date: str, end_date: str) -> List[Dict]: Returns all campaigns within the date range.

  • def calculate_returns(id: str) -> float: Calculates returns for the specific campaign based on its spend and performance metrics.

  • def list_campaigns_by_status(status: str) -> List[Dict]: Lists all campaigns with a specified status.

  • def pause_campaign(id: str) -> None: Pauses an active campaign.

  • def resume_campaign(id: str) -> None: Resumes a paused campaign.

Example 1:
Input: create_campaign('001', 'Holiday Sales', 10000.0, '2023-11-01', '2023-11-30')
Output: Campaign created.
Explanation: A new marketing campaign 'Holiday Sales' has been created with the specified budget and dates.
Example 2:
Input: pause_campaign('001')
Output: Campaign paused.
Constraints:
  • Maximum 1000 campaigns can be created.

  • Budget must be a positive float.

  • Date format must be 'YYYY-MM-DD'.

  • Campaign IDs must be unique and non-empty.
system design Senior api design #9

9. [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 #10

10. [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.

Start practicing Stripe questions

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

Get Started Free