PayPal interview experience Real time questions & tips from candidates to crack your interview

SDE - 2

PayPal
upvote
share-icon
5 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, Operating System, DBMS, Computer Network, OOPS, System Design (HLD/LLD)
Tip
Tip

Tip 1 : Practice Daily. Consistency is the key
Tip 2 : Try to do at least 5 questions daily (LC, gfg, etc any platform u are comfortable with)
Tip 3 : Have some projects on resume related to the tech stack you want to work with.

Application process
Where: Campus
Eligibility: No Cirteria
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Be prepared with in depth questions on whatever is written on resume

Interview rounds

01
Round
Medium
Online Coding Test
Duration75 minutes
Interview date4 Oct 2021
Coding problem2

There were 2 coding questions. One was easy to medium difficult and other was of medium difficulty.

1. Search In The Array

Easy
15m average time
85% success
0/40
Asked in companies
Goldman SachsHCL TechnologiesOYO

You are given two arrays ‘arr’ of size ‘n’ and ‘queries’ of size ‘q’. For each element ‘q’ in the array 'queries', your task is to find the sum of all elements in the array ‘arr’ which are less than or equal to ‘q’.

For example: given array ‘arr = { 1, 2, 3, 3, 4, 5, 6, 7, 9, 10}’ and ‘ queries= { 3, 5}’
Then the sum of all elements whose value is less than or equal to
‘queries[0] = 3’ is ‘ 1+2+3+3 =9’.
‘queries[1] = 5’ is ‘1+2+3+3+4+5 =18’.

You have to return the answer of every query { 9, 18}.

Try solving now

2. Find K Closest Elements

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonMorgan StanleyOptum

You are given a sorted array 'A' of length 'N', two integers 'K' and 'X'. Your task is to print 'K' integers closest to 'X', if two integers are at the same distance return the smaller one.

The output should also be in sorted order

Note:
An integer 'a' is closer to 'X' than an integer 'b' if: 
|a - X| < |b - X|  or (  |a - X| == |b - X| and a < b )
For Example:
if X = 4,  3 is closer to 'X' than 9, as |3-4| < |9-4|  i.e., 1 < 5   and if X = 4, 2 and 6 are equally close to it, as |2-4| == |6-4| = 2, but we say 2 is closer to 4 than 6, as 2 is smaller.
Problem approach

1) There are 2 approaches.
2) First is to sort the array and let two pointers swipe up through the array, whenever the difference between the pointed at elements is smaller than target increase the upper one, whenever it is larger than target increase the lower one. While doing so, keep track of the best result found so far.
3) Another approach is by using TreeMap.

Try solving now
02
Round
Easy
Video Call
Duration60 Minutes
Interview date23 Oct 2021
Coding problem2

1. Reverse Only Letters

Easy
15m average time
85% success
0/40
Asked in companies
AppleOYOPayPal

You are given a string, ‘S’. You need to reverse the string where characters that are not an alphabet stay in the same place, and the rest reverse their positions.

Eg: “a-bcd” becomes “d-cba”

Problem approach

1) I used the 2 pointer approach to solve this. 
2) Start a pointer at start and another at end. If the char at i or j is special char, move one step further, if not then swap the chars at i and j and repeat the same process.

Try solving now

2. Find The Sum Of The Left Leaves

Moderate
25m average time
75% success
0/80
Asked in companies
OYOAdobePayPal

Given a binary tree with ‘root’. Your task is to find the sum of all the left leaf nodes.

Properties of leaf:-

In a binary tree, a leaf is a node such that it does not have any children. Node ‘1’ is always the root of the binary tree. Left leaves are those nodes that are the left child of their parent and a leaf node.

Example:
Let’s say you have a binary tree as follows:-

subsequence

Node 4 and Node 5 are leaf nodes and left child of their parent. Node 6 is a leaf node but not the left child of its parent node 3. Therefore return ‘4+5= 9’ as the answer.

Note:
You do not need to print anything; it has already been taken care of. Just implement the function.
Problem approach

Traverse the tree in any fashion and check if the node is the leaf node or not. If the node is the leaf node, add node data to sum variable.

Try solving now
03
Round
Easy
Video Call
Duration60 Minutes
Interview date23 Oct 2022
Coding problem1

Questions related to Java, OOPs, SQL etc. 

1. Technical Questions

What is JIT compiler?

Scheduling algos.

2nd highest salary using joins of tables

04
Round
Easy
HR Round
Duration60 Minutes
Interview date3 Nov 2021
Coding problem1

It was an HR round.Questions related to resume, Low level design, work experience, behavioural etc. This round stretched more than scheduled time so another round was scheduled which was again a DSA based technical round.

1. Basic HR Questions

What are your hobbies?

Can you handle pressure?

05
Round
Medium
Video Call
Duration60 Minutes
Interview date10 May 2022
Coding problem3

This round had 3 problems. easy, medium and hard.

1. Median of Two Sorted Arrays

Hard
25m average time
65% success
0/120
Asked in companies
GrabAtlassianAmazon

Given two sorted arrays 'a' and 'b' of size 'n' and 'm' respectively.


Find the median of the two sorted arrays.


Median is defined as the middle value of a sorted list of numbers. In case the length of list is even, median is the average of the two middle elements.


The expected time complexity is O(min(logn, logm)), where 'n' and 'm' are the sizes of arrays 'a' and 'b', respectively, and the expected space complexity is O(1).


Example:
Input: 'a' = [2, 4, 6] and 'b' = [1, 3, 5]

Output: 3.5

Explanation: The array after merging 'a' and 'b' will be { 1, 2, 3, 4, 5, 6 }. Here two medians are 3 and 4. So the median will be the average of 3 and 4, which is 3.5.
Problem approach

1) I first used brute force by storing both the arrays in another array, sort the final array and return the middle element if odd or sum of middle two elements if even num of elements. O((m+n) log (m+n))
2) Another approach with linear time complexity is to merge the two sorted arrays and return the median.

Try solving now

2. Check Palindrome

Easy
0/40
Asked in companies
EXL ServiceThalesOptum

You're given an alphabetical string ‘S’.


Determine whether it is palindrome or not. A palindrome is a string that is equal to itself upon reversing it.


For example:
‘S’ = racecar
The reverse of ‘S’ is: racecar
Since ‘S’ is equal to its reverse. So ‘S’ is a palindrome.
Hence output will be 1.
Problem approach

first reverse digits of num, then compare the reverse of num with num. If both are same, then return true, else false. 

Try solving now

3. Minimum Character Deletion

Moderate
15m average time
80% success
0/80
Asked in companies
American ExpressMeeshoAmazon

You are given a string ‘STR’. You need to find and return the minimum number of characters to be deleted from ‘STR’ so that the frequency of each character in the string becomes unique.

Example:
If the given string is “aaBBccc” then the frequency of characters: { a:2, B:2, c:3 }. Now, as ‘a’ and ‘B’ both have the same frequency 2, we need to delete one character either one ‘a’ or one ‘B’, to make their frequency different. After deleting any character we will get frequency as 1,2 and 3, as they all are different. Thus we got our solution as 1.
Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 2
4 rounds | 6 problems
Interviewed by PayPal
1751 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 6 problems
Interviewed by PayPal
1632 views
0 comments
0 upvotes
company logo
SDE - 2
5 rounds | 6 problems
Interviewed by PayPal
8316 views
0 comments
0 upvotes
company logo
SDE - 2
2 rounds | 4 problems
Interviewed by PayPal
971 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
29570 views
8 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
6677 views
1 comments
0 upvotes
company logo
SDE - 2
6 rounds | 8 problems
Interviewed by Amazon
5175 views
0 comments
0 upvotes