Preparing for an interview? Check out Cracking the Coding Interview
Published on

Meta | E5 | MLE | Passed | Menlo Park

Author
  • Shared Anonymously

Hey all, I learned a lot during past 2 months from the community, now it is the time to give back. This is my very first coding interview. So I guess my experience would be particularly useful for beginners.

Background
YOE: 7 years MLE
LeetCode stats: almost no experience at all 2 months ago. Have never done coding interview before.
I was reached out by HR and scheduled a phone interview, and started grinding the 150 tag questions.

Approach to Prepare
Coding
I have never grinded LeetCode before. From the day 1 of reaching out, I tackled the following before the phone screen.

  1. NeetCode's roadmap
  2. top 150 tag questions
  3. Past 6 months of questions found in LeetCode discussion in the interview.

ML System Design

  1. Machine Learning System Design Interview by Ali Aminian and Alex Xu, I read through the whole book twice.
  2. Prepared the ML knowledge using ChatGPT. (You can simply ask please come up with a list of interview questions regarding a topic). I found this way very useful to deepen my understanding.

Behavioral
Searched for common behavior questions, and prepared a concrete answer in advance.

Interview Timeline

  1. Reached out by HR in mid June
  2. Phone Screen in mid July, got the pass email the second day.
  3. Onsite in mid August, got the pass call after 5 business days.

Phone Interview

  1. https://leetcode.com/problems/binary-tree-vertical-order-traversal/description/
  2. https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/description/

No variation. But the interviewer pointed out that my answer to the second question was not optimal during the interview. Luckily I figured out how to solve it optimally during the interview. Solved both within 40 mins.

Coding Interview 1:

  1. https://leetcode.com/problems/sum-root-to-leaf-numbers/ Small variation, it is the sum of the node values, no need to multiply by 10. Solved optimally within 10 mins, provided TC and SC.
  2. https://leetcode.com/problems/meeting-rooms-ii/ Small variation, instead of return the max meeting room number, return any timestamp that has the maximum overlap. I needed a small hint to realize this is the meeting rooms problem, and had a small struggle on returning my timestamp, instead of overlap number. Eventually my solution works but it is a bit ugly. Solved the question in ~ 30 mins, provided TC correclty.

Coding Interview 2:

  1. That flight departure and arrive, and returning the minimum cost problem, discussion before https://leetcode.com/discuss/interview-question/4948676/Meta-or-MLE-or-USA-or-Phone-Screen Solved it optimally within 5 mins, felt worth it of spending hours of digging the problems in discussion.
  2. https://leetcode.com/problems/shortest-path-in-binary-matrix/description/ Solved it optimally within 15 mins. The interviewer was pretty satisfied we only used 20 mins to solve two questions.

The interviewer asked a follow-up question on this of weighted matrix (meaning each step you travel has a weight, the weight is the value of the matrix). I didn't realize I can still use BFS + Heap to sovle the problem. Instead, I coded up a solution using DP. It seems that my solution has some corner cases not covered. But I think the back and forth discussion went pretty well, I was able to explain my intuition and solution clearly. In the end, I am pretty relaxed and felt like a discussion with a teammate, instead of an interview.

ML System Design
Something like harmful content detection, I followed the structure but not exactly the answer by the book. We covered all the components and stretch questions within 40 mins. I think it is important to be flexible, be ready to jump into the particular question that the interviewer is interested in if needed, and jump out to the larger picture when needed. BTW, we didn't use the whiteboard tool at all, the interviewer was totally OK with it.

Behavioral
I was asked about 6-7 questions in total. Luckily all the questions are prepared, and the interviewer also digged into details. The interviewer ran out of question after 40 mins. :)

Notes:

  1. Use CoderPad to practice. Write down the intuition of the solution first (preferrably with a test example) before start coding. In my first question of Phone Screen, I wrote down "class Solution" by habit, but was interrupted by the interview to first explain my thoughts thorougly.
  2. If you are also a beginner, don't feel bad if you can't solve a new problem on your own. I usually search if NeetCode has a solution. If not, I'll check Editorial. You can also ask ChatGPT to explain the code for you.
  3. For Meta, the coding speed and optimal solutions are important, so make sure your answer is optimal. It is very stressful to find out that your prepared solution is not the optimal during the interview. You can ask ChatGPT to optimize your code.
  4. Luck plays a role in the interview. Try your best and leave the rest to your luck. Good Luck!
ReportMark as Helpful