Had my Phone Screen for the New Grad role at Menlo Park for Meta in December 2021. Moved to the On-Site and eventually got an offer. I'll make a post for the on-site in a bit and post an update here. I'll also mention that I graduated w/ a B.S. in 2021 so I was still eligible for the New Grad role since Meta consider New Grad roles for grads up to 9 months post-grad.
The questions asked were 162. Find Peak Element and a variation of 206. Reverse Linked List
Question 1: 162. Find Peak Element
Before starting, I made sure to discuss all possible degenerate/edge cases. For example, things like whether the given array can be None or if it is empty or if all the elements are equal. Discussed briefly about the Brute Force O(N) solution but didn't write out the code. Mentioned that there was a better way of solving it then started by giving the O(logN) solution, explaining the logic behind why it works.
Coded it out and manually ran the code on some test cases, including interesting cases like ascending elements, descending elements, null cases. Couldn't really solve the case for when all elements are equal without running into an exception but the interviewer seemed fine with it.
Final code:
def findPeakElement(nums):
nums.insert(0, float('-inf'))
nums.append(float('-inf'))
left = 1
right = len(nums) - 2
while left <= right:
mid = (left + right) >> 1
if nums[mid - 1] < nums[mid] and nums[mid] > nums[mid + 1]:
return mid - 1
if nums[mid + 1] > nums[mid]:
left = mid + 1
else:
right = mid - 1
return -1Question 2: Variation of Reverse Linked List
The question was: Given a linked list with a duplicate number, reverse the sub-list between the duplicates.
For example, 1->2->3->4->5->2->6 would return 1->2->5->4->3->2->6
Started the question by asking clarifying questions again. One important detail I asked was whether we know that the values given are distinct with the exception of the duplicate values, essentially whether there was only one set of duplicates. Interviewer confirmed that's the case. Another thing I asked was if the duplicate node value was the value as opposed to the reference, so whether or not the list had a cycle. Interviewer confirmed no cycle and its a separate node but with the same value. Lastly, I clarified the usual stuff: whether lists can be None or contain no set of duplicates at all.
Initially I was a bit confused but interviewer hinted at keeping track of seen nodes & values. So I used a HashMap (i.e., dictionary) to store nodes' values mapped to the nodes reference. Then reversed it accordingly. Interviewer didn't want me to implement the reverse function and just assumed that it was already given so that's fine.
I don't remember the final code I submitted but it was slightly incomplete, but the interviewer seemed okay with it nonetheless.
Interviewer Questions:
Had about 5 minutes left for questions to the interviewer. I asked them about what the testing policies for SWEs were (i.e., whether they tested their own code). I also asked about the interaction between SWEs and PMs as well as the day 2 day life for the inteviewer.
Overall, it was an okay experience. Not too bad, not the best either.
Outcome:
Moved to On-Site. Received the news about 2-3 days after the interview
Application Process + Preparation:
Applied on the Facebook Careers page through a LinkedIn redirect around Sept/Oct 2021. Recruiter reached out around November 2021.
Started out with doing the Blind 75 about a month before being contacted by the recruiter since I had another interview lined up and had never done LeetCode before. Initially, I started out just by straight up looking at the solutions since I couldn't come up with anything after 5 minutes. But eventually, I got the hang of Easy/Medium problems. Did the Blind 75 questions on loop about 3-4 times. When the recruiter reached out, I started working on Top 50 Facebook problems on repeat about 5 times. After the phone interview, I started working on Top 100 Facebook tagged (sorted by freq.) and did the Top 100 questions about 6-7 times on repeat before re-doing the blind 75 again for 2-3 times. Overall it was just to drill common concepts. Also I would do random questions from the 14 patterns list.
EDIT: Here's the onsite interview experience