
PayPal


PayPal Full Stack Developer Interview Questions and Answers
Q1. N Queens Problem
Given an integer N
, find all possible placements of N
queens on an N x N
chessboard such that no two queens threaten each other.
Explanation:
A queen can attack another queen if they are in the...read more
The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard where no two queens threaten each other.
Use backtracking algorithm to explore all possible configurations.
Keep track of rows, columns, and diagonals to ensure queens do not threaten each other.
Generate valid configurations recursively and backtrack when a solution is not possible.
Q2. Friends Pairing Problem
The task is to determine the total number of ways to pair up 'N' friends or leave some of them single, following these rules:
- Each friend can either pair with one other friend or stay s...read more
The task is to determine the total number of ways to pair up 'N' friends or leave some of them single.
Use dynamic programming to solve the problem efficiently.
Consider the base cases when N is 1, 2, and 3 to derive the general formula.
The result should be computed modulo 10^9 + 7 to handle large outputs.
Q3. Rearrange String Problem Statement
Given a string ‘S’, your task is to rearrange its characters so that no two adjacent characters are the same. If it's possible, return any such arrangement, otherwise return “...read more
Given a string, rearrange its characters so that no two adjacent characters are the same. Return 'Yes' if possible, 'No' otherwise.
Iterate through the string and count the frequency of each character
Use a priority queue to rearrange characters based on frequency
Check if the rearranged string has no two adjacent characters the same
Return 'Yes' if possible, 'No' otherwise
Q4. Group Anagrams Together
Given an array/list of strings STR_LIST
, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.
Example:...read more
Group anagrams in a list of strings together and return each group as a list of strings.
Iterate through the list of strings and sort each string alphabetically to create a key for grouping.
Use a hashmap to store the sorted string as key and the original string as value.
Return the values of the hashmap as the grouped anagrams.
Q5. Divide Two Integers Problem Statement
You are given two integers dividend
and divisor
. Your task is to divide the integers without using multiplication, division, and modular operators. Return the quotient afte...read more
Divide two integers without using multiplication, division, and modular operators, returning the floored value of the quotient.
Implement division using bit manipulation and subtraction
Handle edge cases like negative numbers and overflow
Return the floored value of the quotient
Q6. Vertical Order Traversal Problem Statement
You are given a binary tree, and the task is to perform a vertical order traversal of the values of the nodes in the tree.
For a node at position ('X', 'Y'), the posit...read more
Perform vertical order traversal of a binary tree based on decreasing 'Y' coordinates.
Traverse the binary tree level by level and maintain the position of each node
Use a map to store nodes at each position and sort them based on 'Y' coordinates
Print the nodes in sorted order for each position to get the vertical order traversal
To maximize the number of balloons burst with an arrow, target the balloons with the most adjacent balloons.
Identify clusters of balloons that are adjacent to each other.
Target the balloons in the clusters with the most adjacent balloons to burst the maximum number.
Consider the position and size of the clusters to strategically burst the balloons.
Interview Process at PayPal Full Stack Developer

Top Full Stack Developer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

