PayPal Coding Interview Questions
25 PayPal coding interview problems with full optimal solutions — 16 easy, 6 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an PayPal interviewer values, and a FAQ section.
- #1easyfrequently asked
1. Two Sum
Given an array of integers and a target, return indices of the two numbers that add up to the target. PayPal asks this to gauge whether you reach for a hash map immediately — the same reflex they want when you're matching a payment to a pending invoice by amount.
- #2easyfrequently asked
2. Valid Parentheses
Given a string of brackets, decide whether they are balanced. PayPal asks this as a stack-comfort warm-up — the same data structure that powers their transaction-state-machine stack for rollback on failed payments.
- #3easyfrequently asked
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list by splicing nodes together. PayPal asks this as a warm-up to gauge pointer comfort — the same primitive they use when merging two sorted streams of authorized and captured payments by timestamp.
- #4easysometimes asked
4. Remove Duplicates from Sorted Array
Remove duplicates from a sorted array in-place and return the new length. PayPal asks this to test the two-pointer reflex — the same technique they apply when deduplicating idempotency keys in a sorted append-only ledger.
- #5easysometimes asked
5. Remove Element
Remove all occurrences of a value from an array in-place and return the new length. PayPal uses this to test the same two-pointer reflex they need when filtering reversed transactions out of a daily settlement batch.
- #6easysometimes asked
6. Search Insert Position
Given a sorted array and a target, return the index where target is found, or where it would be inserted to keep the array sorted. PayPal asks this to test whether you can write a bug-free binary search — the foundation for fast lookups in their sorted fraud-rule index.
- #7easysometimes asked
7. Plus One
Given a non-empty array of digits representing a large integer, increment it by one. PayPal asks this to test arbitrary-precision arithmetic awareness — currency amounts at scale exceed 64-bit, and you cannot lose a cent to overflow.
- #8easysometimes asked
8. Merge Sorted Array
Merge two sorted arrays in-place into the first one (which has buffer space at the end). PayPal asks this to test reverse-pointer thinking — the same approach they use when interleaving an authorized-transactions buffer with a capture-events buffer for end-of-day reconciliation.
- #9easysometimes asked
9. Binary Tree Inorder Traversal
Return the inorder (left, root, right) traversal of a binary tree's nodes. PayPal asks this to test stack-based iterative thinking — the same scaffolding used to walk a transaction-tree where parent transactions point at children (settlement → captures → auths).
- #10easysometimes asked
10. Same Tree
Given two binary trees, decide if they are structurally identical and the nodes have the same values. PayPal asks this as a recursion warm-up — the same shape used when diffing two snapshots of a transaction-state tree to detect tampering or replay.
- #11easysometimes asked
11. Symmetric Tree
Decide whether a binary tree is a mirror of itself. PayPal uses this as a recursion check — testing whether you can write a helper that compares two trees with mirrored axes, the same pattern they use for symmetric-link reconciliation between buyer-side and seller-side transaction graphs.
- #12easyfrequently asked
12. Maximum Depth of Binary Tree
Find the maximum depth of a binary tree. PayPal uses this as a recursion litmus — the same primitive they use to measure the depth of a chain of related transactions when investigating circular fraud rings.
- #13easysometimes asked
13. Path Sum
Determine whether a binary tree has a root-to-leaf path whose node values sum to a given target. PayPal uses this to test recursive tree traversal and base-case handling under financial-rule evaluation scenarios.
- #14easysometimes asked
14. Pascal's Triangle
Generate the first numRows rows of Pascal's triangle where each element is the sum of the two elements above it. PayPal asks this to evaluate 2D array construction skills and pattern recognition relevant to combinatorial financial modeling.
- #15easyfrequently asked
15. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy-sell transaction in a price array. PayPal treats this as a core financial-reasoning problem — interviewers look for candidates who can frame it as tracking running minimum and maximum gain.
- #16easysometimes asked
16. Single Number
Find the one element in an array that appears exactly once while all others appear exactly twice. PayPal uses this to probe XOR bit-manipulation knowledge and constant-space thinking — skills tied to low-level transaction-ID deduplication logic.
- #17mediumfrequently asked
17. Add Two Numbers
Add two non-negative integers represented as reversed linked lists and return the sum as a linked list. PayPal favors this problem because carry propagation mirrors real-world multi-precision arithmetic in payment processing systems.
- #18mediumfrequently asked
18. Longest Substring Without Repeating Characters
Find the length of the longest substring with all unique characters. PayPal uses this classic sliding-window problem to evaluate candidates' ability to maintain a dynamic window — directly analogous to deduplication windows in real-time transaction stream processing.
- #19mediumsometimes asked
19. Container With Most Water
Find two vertical lines that together with the x-axis form a container holding the most water. PayPal uses this two-pointer classic to test greedy reasoning and candidates' ability to prove why a pointer-shrink strategy is optimal — a proof skill valued in financial algorithm design.
- #20mediumfrequently asked
20. 3Sum
Find all unique triplets in an array that sum to zero. PayPal frequently asks this to test duplicate-skipping discipline and two-pointer mastery — skills that map to deduplication in reconciliation engines that match debits and credits across accounts.
- #21mediumsometimes asked
21. Group Anagrams
Group strings that are anagrams of each other into arrays. PayPal uses this hash-map grouping problem to evaluate key normalization skills — a pattern that appears in transaction deduplication and merchant category clustering in payment systems.
- #22mediumfrequently asked
22. Number of Islands
Count the number of islands (connected components of '1's) in a binary grid. PayPal uses this BFS/DFS grid traversal problem to test graph connectivity reasoning — directly applicable to fraud ring detection where connected transaction nodes form suspect clusters.
- #23hardsometimes asked
23. Median of Two Sorted Arrays
Find the median of two sorted arrays in O(log(min(m,n))) time without merging them. PayPal asks this hard binary-search problem to identify engineers who can handle statistical aggregations over large financial data streams where merging is prohibitively expensive.
- #24hardsometimes asked
24. Trapping Rain Water
Compute the total volume of water trapped between bars of varying heights. PayPal asks this problem to gauge candidates' ability to reason about prefix/suffix aggregations — a pattern that underlies cumulative transaction balance calculations and risk exposure windows.
- #25hardsometimes asked
25. Sliding Window Maximum
Return the maximum value in every sliding window of size k over an array in O(n) time. PayPal uses this deque-based problem to test candidates on streaming aggregation — a core primitive in real-time fraud scoring and transaction risk-window analysis.
Related interview-prep guides
Codility for Tech Interviews in 2026: The Complete Guide for Candidates
Codility is the dominant algorithmic-assessment platform across European tech hiring. Heavy in the UK, Germany, Netherlands, Nordics, and Poland where the company was founded. It scores candidates on both correctness and time complexity, runs 60-to-120-minute timed tests, and ships three products: Tests, CodeCheck, and CodeLive. This guide is what 2026 candidates need to know.