Facebook | Phone Assessment
Anonymous User
2298

This is Phone Assessment for Facebook E4 position for Menlo Park.

Q1: Input array [3, 2, 4, 3, 5, 3, 5, 2, 9] of sizeN, given number K, return an array of sizeK, which is randomly picked from input array
Q2: Input sorted array [3, 3, 3, 4, 5, 6, 6, 7] of sizeN, given number K, return the number of occurance for K in the input array
(https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/)

My approach:
Q1: Since interviewer asked about an array of sizeK, I verified if it can be any array. Since interviewer said yes, I said I can simply return 1st K elements for which interviewer said, sure - go ahead.
Once I completed solution, interviewer then asked how come its random values. [I felt interviewer appeared distracted as that was my first clarification when I got the question]. I then chose Math.random function to get random indices. This time interviewer asked me worst case possibility. I said that if I store already used indices in a Set such as visited, it would be O(K) to pick values of size K. Interviewer then said that that there is possibility of getting same element everytime (even after I explained about using a set to store visited indices).

Overall it felt horrible when interviewer doesn't pay attention during interview (I had to explain that visited holds indices and not values in array thrice when explaining approach)

Q2: I solved this question multiple times so it was easy to answer. I gave O(logN) solution. Since I had < 10 min, interviewer asked to get just left boundary and I did it in time.

Result:
Reject

Overall Experience:

  • Interviewer joined late. Joined after I messaged recruiting coordinator that Interviewer hasn't joined the call
  • Interviewer wasn't listening for first 15 min. I had to explain thrice that I am storing indices of array and not values

Conclusion:
It feels bad that I stayed focused on preparation for 30 days to crack this interview and interviewer didn't have attention for 45 min of interview.
I wish there are 2 interviewers so that determination is not solely based on one person

Comments (11)