I recently gave Paypal interview for SDE 2 and following questions were asked in round 1:
1> Given a number, convet it to it's binary representation and number can be negative.
-Solved it with the help of binary shift operation. Following was the code :
public static String convetrAll(int n) {
StringBuilder sb = new StringBuilder();
for(int i=0;i<32;i++) {
int bit = (n&(1<<i))== 0? 0:1;
sb.append(bit);
}
return sb.reverse().toString();
} 2> Given a matrix, give the difference b/w diagonal and antidiagonal.
Solved with following code :
public static int nBy2A(int[][] matrix) {
int j=matrix.length-1;
int i=0;
int aSum = 0;
int bSum =0;
int up=0;
int down=matrix.length-1;
while(up<down) {
aSum+=matrix[up][i]+matrix[down][j];
bSum+=matrix[j][up]+matrix[down][i];
up++;
down--;
i++;
j--;
}
return Math.abs(aSum-bSum);
}After this, interviewer was satisfied and we ended the interview. I was told by recruiter that i cleared the first round and was asked if i am available later the day. Since i had my office work as well, i asked if it could be on Monday to which she replied "Monday they have holiday, She will schedule sometime next week". I even asked if i dont give interview today itself will it impact my candidature, to which se replied that it wont. I tried to contact her later but then number was switched off. I mailed her regarding next step but did not get any reply.
Takeaway ; When you get a call from Paypal recruiter, try finishing the entire recruitement process till HR's number is active. I think since i was not availble, they might have hired someone who gave his interview same day and since the position would have been filled, she might have changed the number and the new number will be active untill above cycle is repeted.
With this i can conclude that just like criminals change their phone number as soon as their job is done, Paypal recruiters change their no as soon as a recruitement event is completed.
Suggestion to Paypal : A mail from recruiter saying "Hey, the postion is filled. We will come back to you if similar position opens up again" would have been better as it would have given me peace of mind rather than feeling like "disposable candidate" for them.