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

SDE - 2

PayPal
upvote
share-icon
5 rounds | 13 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Data Structures, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Prepare resume in the way in which your resume should talk about yourself rather than explaining your resume to others.( Add a small description for each major projects and features which we worked on)
Tip 2 : Practice competitive coding on regular basis with most optimised way rather than trying to overdo everything in one go. Allocate some time dedicatedly for this. 
Tip 3 : Note down the important techniques, areas , topics in a sheet or doc so that they can be helpful during the time of recap.
Tip 4 : Update any job platform profile up to the date and enable open to work option as "show recruiters" or "show to all" as per your requirement so that recruiters can approach you with matching opportunities. 
Tip 5 : Approach recruiters directly if you came across any openings so that they can fast track your application.

Application process
Where: Linkedin
Resume Tip
Resume tip

Tip 1 : Order of resume is very important. Mention your skills and work experience in top 2 sections and add needed short description about the projects which you worked on. 
Tip 2 : Clearly add everything which you contributed in your current organisation with some statistics and your role in that. (example : I have pushed out a code change so that the response time for a particular endpoint came down to 1ms from 10ms)

Interview rounds

01
Round
Hard
Online Coding Test
Duration90 mintues
Interview date15 Apr 2022
Coding problem2

2 coding questions to be solved in 90 mins and can start test anytime within 3-4 days since we received the challenge.

1. Max tasks in the given Budget

Moderate
30m average time
55% success
0/80
Asked in company
PayPal

You are given a straight line starting at 0 to 10^9. You start at zero, and there are ‘N’ tasks you can perform. ‘ith’ task is located at point 'Task[i][0]' in the line and requires 'Task[i][1]' time to be performed.

To perform the task, you need to reach the point 'Task[i][0]' and spend 'Task[i][1]' time at that location. e.g. (5,8) lies at five, so travel distance is five, and work effort is 8.

It takes one second to travel one unit of the path.

Now, we are given a total of ‘totalTime’ seconds, and we need to complete as many tasks as possible and reach back to starting position.

Find the max number of tasks that you can finish in ‘totalTime’.

For example:

3 tasks and 16 units of total time.
Task = [( 2, 8 ) , ( 4, 5) , ( 5, 1)]
( 2, 8 ) -> task 1 at position 2 in line and takes 8 sec to complete.
( 4, 5)  -> task 2 at position 4 in line and takes 5 sec to complete.
( 5, 1) -> task 3 at position 5 in line and takes 1 sec to complete.
Skipping the first task leaves us enough time to complete the other two tasks. Going to the location of the third task and coming back costs 2x5 =10 sec, and performing tasks at locations 4 and 5 cost us 5+1 = 6 sec. 
Total time spent will be 10+6=16 sec.
Problem approach

I first solved it using the recursive approach, but the interviewer was not happy. He asked me for any other optimised approach then I thought of Hamiltonian cycle and the interviewer was then satisfied

Try solving now

2. Beautiful Number

Moderate
25m average time
70% success
0/80
Asked in companies
PayPalGrowwD.E.Shaw

Ninja loves beautiful numbers and also has two integers, ‘L’ and ‘R’, denoting an interval [L, R].

Given the interval [L, R], Ninja wants you to find the number of Beautiful numbers in the interval.

A Beautiful Number is a number that:

Becomes 1 by repeatedly replacing the number with the sum of squares of its digits.

If the number does not become 1, then it’s not a Beautiful Number.

For example, given interval = [1, 3]

We see that 1 is a Beautiful Number but 2,3 are not. Hence the answer is 1.

Output the single integer, the sum of all Beautiful Numbers in the given range.

Example:
Input: ‘L’ = ‘1’ ,  'R' = ‘3’

Output: 1

As ‘1’ is the only Beautiful Number.

3 is not Beautiful as, 
3 -> 9
9 -> 81
81 -> 65
65 -> 61 … and so on
It can be shown that we cannot get 1. 
Problem approach

There is an optimal solution where we travel from 0 to some coordinate x and back, greedily choosing tasks in the interval [0, x] from shortest to longest.

There might be a dynamic programming solution, but it's not what I would reach for first. Rather, I'd use a sweep-line algorithm that increases x from 0 to T/2, maintaining an optimal solution. When x passes l[i], we add task i to the agenda. Whenever the current agenda uses too much time, we drop the longest task.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date30 Apr 2022
Coding problem4

This is a DSA round. As the expectation of the round is to test your knowledge, finish your self intro within 3 minutes so that interviewer can ask few more questions so that he/she can evaluate you even better.

1. Search In Rotated Sorted Array

Moderate
30m average time
65% success
0/80
Asked in companies
FreshworksExpedia GroupPayPal

Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4, 5] and if he rotates it by 2, then the array becomes: [4, 5, 1, 2, 3].

After rotating a sorted array, Aahad needs to answer Q queries asked by Harshit, each of them is described by one integer Q[i]. which Harshit wanted him to search in the array. For each query, if he found it, he had to shout the index of the number, otherwise, he had to shout -1.

For each query, you have to complete the given method where 'key' denotes Q[i]. If the key exists in the array, return the index of the 'key', otherwise, return -1.

Note:

Can you solve each query in O(logN) ?
Problem approach

As the problem statement does not mention to do binary search directly. Understanding the problem statement is very important and should listen properly what the interviewer was expecting.
Next discuss the approach and solution with the interviewer before going for actual coding. Perform a dry run if confident.

Try solving now

2. System Design

How can we ensure backward compatibility while doing any changes in any API.

Problem approach

Tip 1 : Explain all the approaches that you have in your mind.
Tip 2 : Ensure that interviewer understands your answer clearly rather than going at your pace.

3. Delete a Node from Linked List

Moderate
40m average time
67% success
0/80
Asked in companies
QualcommFreshworksSamsung

You have been given a linked list of integers. Your task is to write a function that deletes a node from a given position, 'POS'.

Note :
Assume that the Indexing for the linked list always starts from 0.

If the position is greater than or equal to the length of the linked list, you should return the same linked list without any change.
Illustration :
The following images depict how the deletion has been performed.

Image-I :

Alt txt

Image-II :

Alt txt

Problem approach

As this question is some what different to what we do regularly, invest some time in thinking this and explain your approach to the recruiter properly.
As in this case we have only the node to be deleted, we can find next node and then swap the next node value to the previous node and then delete the next node which is most optimised solution.

Try solving now

4. Largest subarray with equal number of 0s and 1s

Moderate
10m average time
85% success
0/80
Asked in companies
PhonePeSAP LabsAmazon

You are given an array consisting of 0s and 1s. You need to find the length of the largest subarray with an equal number of 0s and 1s.

For example:

If the given array is: [0, 0, 1, 0, 1] The largest subarray would be: [0, 1, 0, 1] (last 4 elements) having length 4.
Problem approach

Take some time to think about the solution here because the expectation is to solve the problem in optimised way.
Discuss your every solution which you thought to your interviewer and engage the interviewer in your thinking process.
Perform a dry run for the final approach which you thought of so that interviewer can trust your solution even though your code doesn't execute.

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date30 Apr 2022
Coding problem3

DSA round 2. If we clear this round we will be mapped to system design round, else we may need to take another round of DSA and problem solving.

1. Balanced parentheses

Moderate
10m average time
90% success
0/80
Asked in companies
WalmartMakeMyTripGoldman Sachs

Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.

Note :

Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.

2. Open brackets must be closed in the correct order.

For Example :

()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Problem approach

As the problem suggests, form a proper data structure so that your solution becomes easy to write.
Explain your approach to the interviewer properly and ensure if the interviewer was satisfied with the solution you provided.

Try solving now

2. Shortest subarray with sum at least K

Moderate
15m average time
85% success
0/80
Asked in companies
ApplePayPalMAQ Software

Given an array/list 'ARR' of integers and an integer ‘K’. You are supposed to return the length of the shortest subarray that has a sum greater than or equal to ‘K’. If there is no subarray with a sum greater than or equal to K, then return -1.

Note :
An array ‘B’ is a subarray of an array ‘A’ if ‘B’ that can be obtained by deletion of, several elements(possibly none) from the start of ‘A’ and several elements(possibly none) from the end of ‘A’. 
Problem approach

Expectation is to write code with better time and space complexity than writing the code in brute force approach.
Take time and involve the interviewer in your design so that he/she can get or understand your thought process.

Try solving now

3. Validate BST

Moderate
25m average time
0/80
Asked in companies
FacebookAmazonFreshworks

You have been given a binary tree of integers with N number of nodes. Your task is to check if that input tree is a BST (Binary Search Tree) or not.

A binary search tree (BST) is a binary tree data structure which has the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.
Example :

BST1

Answer :

Level 1: 

All the nodes in the left subtree of 4 (2, 1, 3) are smaller 
than 4, all the nodes in the right subtree of the 4 (5) are 
larger than 4.

Level 2 :

For node 2:
All the nodes in the left subtree of 2 (1) are smaller than 
2, all the nodes in the right subtree of the 2 (3) are larger than 2.
For node 5:
The left and right subtrees for node 5 are empty.

Level 3:

For node 1:
The left and right subtrees for node 1 are empty.
For node 3:
The left and right subtrees for node 3 are empty.

Because all the nodes follow the property of a binary search tree, the above tree is a binary search tree.
Problem approach

As this problem can be solved with various approaches, consider the solution with the O(1) space complexity as it was clearly mentioned in the requirements.
Share other solutions as well if your interviewer agrees

Try solving now
04
Round
Medium
Video Call
Duration60 minutes
Interview date30 Apr 2022
Coding problem3

Initially interviewer went thorough the resume and asked Technical Questions on any selected project in resume.

1. System Design

System design for movie reservation system (LLD) ,requirement gathering ,DB schema design, APIs that need to be used.

Problem approach

Tip 1 : Understand the requirements first. List down all requirements in any editor.
Tip 2 : After analysing the requirements form entities and DB schema accordingly.
Tip 3 : Follow naming conventions and describe appropriate data types for the entities.

2. DBMS

Optimising given SQL queries and DB locks like select on update etc

Problem approach

Tip 1 : Understand the problem statement and then try to use various techniques to optimise the SQL queries.
Tip 2 : Discuss all the approaches which hit your mind to the recruiter, make the interview engaging.

3. Operating System Question

  • Spring boot questions on synchronized , java locks, etc
  • Streams in java and multithreading.
Problem approach

Tip 1 : Revise all java concepts and explain with a example for every concept rather than explaining the core definition.
Tip 2 : Clearly say if you are not aware of the particular concept (if not known), interviewer will replace that with other good question.

05
Round
Easy
HR Round
Duration40 minutes
Interview date30 Apr 2022
Coding problem1

Hiring manager round (Behavioural questions)
 

1. Basic HR Questions

Current company and CTC.
Reason for job change.
Questions on projects in resume.
Questions on cloud providers like AWS, GCP etc…
And other questions like process followed while given a task.
Questions on open with full stack areas and discussion of FE work which was done.

Problem approach

Tip 1 : Reply with confidence

Tip 2 : Stay honest. Don't fake anything

 

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
972 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