PayPal logo

PayPal Medium Interview Questions

3 medium-level practice questions for PayPal technical interviews

PayPal 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 Medium Verified Question #1

1. Student Grade Management System


Category: String coding problem

Question Design a student grade management system consisting of two classes: Student and Result. Student Class Implement a Student class...

Input: String
Output: Printed output
coding Medium tree #1

1. Binary Tree Depth Calculation — Calculate the maximum depth of a binary tree

Background: PayPal employs complex data structures to manage transaction workflows and user account hierarchies. Understanding the depth of binary trees can help optimize search operations in these systems.
Problem statement: Given a binary tree, determine its maximum depth. The function should return the number of nodes along the longest path from the root node down to the farthest leaf node. A leaf is a node with no children.
Function/class signature:
  • def max_depth(root: Optional[TreeNode]) -> int:


Example 1:
  • Input: root = [3,9,20,null,null,15,7]

  • Output: 3

  • Explanation: The maximum depth is 3 because the longest path is 3 -> 20 -> 15.


Example 2:
  • Input: root = [1,null,2]

  • Output: 2

  • Explanation: The maximum depth is 2 because the longest path is 1 -> 2.


Constraints:
  • Node count in the tree can range from 0 to 1000.

  • Each node's value is at most 1000.

  • root can be None for an empty tree.
coding Medium graph #2

2. Graph — Find the Shortest Payment Path


Background: In financial transactions, finding the shortest path for payments between two linked financial institutions can optimize transaction processing. This relates to PayPal’s payment system, aiming to minimize transaction fees and times.
Problem statement: Given a directed acyclic graph where nodes represent financial institutions and edges represent transaction fees between them, write a function to find the minimum transaction fee necessary to transfer money from a starting institution to a target institution. The output should indicate both the minimum fee and the path taken.
Function/class signature:
  • def find_minimum_fee_path(start: str, target: str, edges: List[Tuple[str, str, int]]) -> Tuple[int, List[str]]:


Example 1:
Input: start = "A", target = "C", edges = [("A", "B", 1), ("B", "C", 2), ("A", "C", 5)]
Output: (3, ["A", "B", "C"])
Explanation: The minimum fee from A to C is through B with a total fee of 3 (1 + 2).
Example 2:
Input: start = "A", target = "D", edges = [("A", "B", 4), ("B", "C", 2), ("C", "D", 1), ("A", "D", 10)]
Output: (7, ["A", "B", "C", "D"])
Constraints:
  • The graph will have at most 100 nodes.

  • Each edge's transaction fee will be a positive integer not exceeding 100.

  • There may be multiple edges between two nodes but only one directional path exists in the graph.

  • Node names will consist of uppercase letters only.

Start practicing PayPal questions

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

Get Started Free