Meta I Software Engineer University Grad Interview Experience
Anonymous User
4312

In December 2020 I applied for "Software Engineer, University Grad" position at Facebook (now Meta).
I was contacted by the recruiter in a few days to schedule the Screening Interview.

1) Screening Interview:
The interview was of 45 minutes.
Following questions were asked:

  1. https://leetcode.com/problems/kth-largest-element-in-an-array/
    My solution:
    Brute Force approach where I will sort the array and return kth element from the end of the array.
    The interviewer asked me to optimize it further and then I coded the solution which involved using min heap.
  2. https://leetcode.com/problems/clone-graph/

In both the cases, I was asked to dry run my code and also analyze the space and time complexity.

Virtual Onsite Interview:

1) Behavioral Round:
Following questions were asked by the interviewer:
-Most challenging project
-Time when I received a constructive feedback
-A person who was difficult to deal with in a professional setting
-If I had any arguments with fellow team member

2) Coding Round 1:
The interview was of 45 minutes. (Last 5 minutes are reserved for the candidates to ask any questions, so we have only 40 minutes to solve two questions)
Following questions were asked:

  1. Given a 2D binary matrix with 1s and 0s in the cell, you have to find a path from upper left corner to bottom right corner. You can traverse the 0s but 1s are blocking cells. And print the path if it exists. It is a variation of the following question on leetcode:
    https://leetcode.com/problems/shortest-path-in-binary-matrix/
    I first suggested a depth first solution and the interviewer asked me its space complexity. I answered (nrows * ncols). However, the correct answer was (nrows + ncols). The interviewer also asked if there is any other solution and I suggested a breadth first search approach. Then (s)he asked which one was better and why. (S)he suggested me to code the BFS solution and then asked me to write down as many test cases as possible. Be sure to handle cases such as:
    -Grid exists but has no rows or columns
    -Grid does not exist, check if its null
    -The first cell has a value 1
    -The last cell has a value 1

  2. BST Iterator:
    https://leetcode.com/problems/binary-search-tree-iterator/
    The interviewer asked if there was anything in the code that can be improved. I wondered for a minute but then (s)he changed the topic.

3) Coding Round 2:

  1. Minimum Remove to Make Valid Parentheses
    https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/
    After explaining and coding the solution, the following questions were asked"
    -Time and Space Complexity
    -If there was any way to reduce the space complexity to O(1).
    -What if strings were mutable in java, then would it be possible to reduce the space complexity to O(1)?

  2. Subarray sum equals k:
    https://leetcode.com/problems/subarray-sum-equals-k/solution/
    Follow up questions:
    -Time and Space Complexity
    -If there is any way to optimize the code if only positive values are included. (Sliding Window)

Few notes which might help:

  1. I feel answering the follow up questions, questions about space and time complexity, questions about the way you write your code is also important and also plays a part in communicating your knowledge to the interviewer. One should take a moment and try answering these questions with utmost care.
  2. Next, think of all the possible test cases as if you are writing solution for a real world problem. Writing down those test cases on coderpad and explaining how you have handled them in your code helps a lot.
  3. Walk an extra mile, for example, if you have been asked a question about Linked List or Binary Tree, you can quickly write the TreeNode or ListNode structure/class in a few seconds unless your interviewer is in a hurry and explicitly tells you not to write them.
  4. If you have previously seen the question on leetcode, be sure to solve the problem a little fast, keep an eye on the timer, make sure you get its space and time complexity correct.
  5. Dont be shocked if you are asked to write multiple solutions for the same problem. For example: After you code a BFS solution, the interviewer can ask you to quickly write down a function for its equivalent DFS variation.

PS: I received the offer! Thank you!

Comments (5)