Cracking the Facebook’s Machine Learning SWE Interview.
By: Anjul Tyagi
Tags: Data Science, Interview, Facebook, Machine Learning, Interview Tips

Photo on Unsplash by Alex Haney

Cracking the Facebook’s Machine Learning SWE Interview.

I recently passed Facebook’s Machine Learning Software Engineer (Ph.D.) internship interview. In this post, I share my interview experience and the resources I used to prepare for the interview.

To cover the complete interview process, I have divided this post into separate events based on the timeline. This will help you to evaluate the process and preparation time required for each stage of the interview better.

Important Take-Aways, read further to learn about each stage of the interview.

Give yourself time to prepare, the more time you take to prepare, the better are the odds. Try to solve ~150 coding questions before actually appearing for the interview.

Practice coding in an actual interview scenario, and not just solve questions. Use additional resources like binarysearch.com, pramp.com to get acquainted with the interview tension, and time constraint coding.

Do a thorough walkthrough over your resume, you need to know every single detail of your projects and explanations of why you did things a certain way.

About Me (at the time of the interview)

If you are looking to interview for a similar position, it is important to evaluate the profiles which get picked for the interview process. Now, I don’t know exactly how my profile stood in the pool of candidates, but I am sharing my resume as a sample profile that got picked for such interviews.

My resume at the time of the interview.

My Google Scholar Page at the time of the interview.

As you can see, I had completed 3 years of my Ph.D. by this time, publishing majorly in the areas of Machine Learning, Data Visualization, and Computer Vision. I also applied for this position during my third year but I wasn’t interviewed since my graduation date was after 2 years from the date of the application. Going from this, it is evident that Facebook prefers hiring candidates who are graduating at around a year from the date of the internship, as they have a higher chance of joining the team after graduating.

September 1st: The Recruiter Call

I interviewed for the Software Engineer, Ph.D. Intern/Co-op (Machine Learning) position at Facebook. This all started when I received an email from one of the recruiters asking if I was looking for ML SWE interns for the summer of next year, further asking the questions listed below:

About your PhD research Month and year of expected graduation Preference of locations for Facebook offices, i.e. Menlo Park, New York, Boston and Seattle Are you actively interviewing for other positions

September 3rd: Providing Availability

Since it was still early in the hiring season for summer internships, I was asked to provide my availability within the next two months. Since I wasn’t at all prepared for the coding interviews, I chose the dates close to the end of October, so as to give myself ample time to prepare. In the meantime, we are asked to fill up the work authorization and other forms on their careers website. Following all this, my interviews were scheduled to be held on October 26th, and there are two interview sessions, each of 45 mins duration. As per listings on their careers website and recruiter suggestions, we are expected to solve two medium/hard coding questions in each of the sessions. Facebook uses coderpad to conduct their interviews, where your code is shared with the interviewer and you are on a video call with the person on bluejeans.

September 3rd — September 10th: Checking out Facebook’s prep resources

The best part of interviewing with Facebook is that they want you to succeed as badly as you want for yourself. Hence, they have prepared extensive resources for you to prepare well for these interviews and they try their best to answer every question you might have about the process.

So, I started off by spending a week carefully going through every resource my recruiter shared with me. This turned out to be the best decision in this process since I was able to clearly understand the process of acing a coding interview. These resources are listed below, make sure to check them out if you are planning to appear for any coding interview.

Facebook real interview session videos and guide : link This is by far the most comprehensive guide to prepare for any technical coding screening. It lists all the important videos, tutorials, and some (easy) sample questions to help you brush up your coding skills.

: link This is by far the most comprehensive guide to prepare for any technical coding screening. It lists all the important videos, tutorials, and some (easy) sample questions to help you brush up your coding skills. Facebook’s technical screening website : https://www.facebook.com/careers/swe-prep-techscreen?hc_location=ufi

: https://www.facebook.com/careers/swe-prep-techscreen?hc_location=ufi A good read : https://medium.com/@XiaohanZeng/i-interviewed-at-five-top-companies-in-silicon-valley-in-five-days-and-luckily-got-five-job-offers-25178cf74e0f

: https://medium.com/@XiaohanZeng/i-interviewed-at-five-top-companies-in-silicon-valley-in-five-days-and-luckily-got-five-job-offers-25178cf74e0f Interviewer office hours: This is a unique thing not very commonly seen in this area of interviewing. Facebook allows the upcoming interviewees to talk to one of the employees about their questions on the technical screening rounds. Also, there is a mock interview session that can help candidates understand the process (dos and don'ts) better.

Facebook hosts office hours for upcoming interviewees to talk to real Facebook’s interviewers.

September 11th — October 25th: Coding and Mock Interviews

Mock Interviews (pramp.com) — 32 sessions

I cannot emphasize enough, the importance of mock interviews in getting ready for a coding interview. Of course, you need to practice solving problems, but it is equally important that you get used to solving problems in an interview sort of tense environment. It’s more of mental training and practicing how to think about an unseen problem during an interview. I really started enjoying these mock interviews and they served as a warm-up round before eventually giving an actual interview, so I ended up giving a mock interview even on the day of my actual interview, to get rid of the cold start my brain suffers from :D.

My mock interview sessions during the time of preparation.

Leetcode ~ 150 questions (September 11th — October 14th)

I solved ~70 top Facebook interview questions and ~80 top interview (Medium and Hard Questions) from Leetcode. Since the time was limited and I only spent <4 hrs/day preparing for the interview, if stuck and had no clue about the problem, I would look at the solution. Also, I tried not to spend more than 30 mins on each problem. To refer to my notes for last-minute revision of the problems I solved, please refer to this post.

Top Facebook, and general interview question decks on leetcode.

BinarySearch.com — Race against time

The website, binarysearch.com has many cool features of competing against other competitive programmers, but one feature which proved very helpful in my preparation for the interview was time constraint coding practice. We can practice, company-focused top interview questions from four difficulty levels with a running clock, for example, 30 mins to solve a hard problem, etc. This is a great way to get used to the pressure of an interview, typically with Facebook where you are expected to solve 2 problems in around 35 mins during an actual interview. It is important to practice unseen problems and solve them in a limited time constraint to be able to perform your best during the interview.

Create Rooms for time constraint problem solving on binarysearch.com

Revision (October 14th-25th)

Revision plays an important role when we try to learn too much in a relatively short period of time. It proved useful to mark important questions and taking notes while I was solving the coding problems during my practice phase to quickly revise what was needed. Also, I continued practicing with mock interviews and time constraint coding during this phase. You’ll notice that by this time, after giving several mock interviews, you’ll be more confident going into the interview than before.

October 26th: Day of the interview

Sleep well before the interview day and give a mock interview before the actual interview if your brain suffers from a slow start problem. On the day of the interview, my experience was actually very similar to the mock interviews I had been giving for days. The interviewers were very nice, soft-spoken, and very clear in their communication about the problems. I was asked to solve two problems in each of my two interviews. The basic technique I used to solve the problems during an actual interview consists of six steps, thanks to Gayle Laakmann and her interview tips I shared in the previous section. The steps are:

Ask clarifying questions: Make sure you understand the question completely. For eg, what’s the data type of the array, is there any constraint on the length of the array, etc. Discuss your algorithm over an example: After you understand the problem completely, make sure to come up with a medium-sized example to walk the interviewer through your algorithm. The example shouldn’t be an edge case at this point. Explain the time and space complexities: Make sure to point out the space and time complexity of your solutions at this point and confirm with the interviewer that they are okay with the solution you provided. Code: Once you know that the interviewer is okay with your solution, code it. Code Walkthrough: Walkthrough your code with the example you took previously and make sure everything is in place. Discuss edge cases: At this point, when your code works for a general solution, try covering all the edge cases.

October 27th: Coding Round Result

I received an email from my recruiter mentioning my feedback and discussion about the next, Team-Matching rounds.

A portion of the email from the recruiter discussing the coding round results.

October 28th — November 9th: Team Matching Preparation

Once you clear the coding round, Facebook technically wants you to join but the offer depends on a successful team match. Based on the location preference you provided to your recruiter in the previous emails, you’ll be given a list of teams currently looking for interns at those locations. The first step is to fill out a survey of the teams you’ll be most interested in interviewing with. I provided Menlo Park as my first preference and was asked to provide the name of 5 teams I would like to interview with. This number depends on the location and the time you are interviewing with Facebook, so if it’s not 5 for you, don’t panic. The google form covers all the teams and a short summary of what the teams are working on. This is to help you decide and come up with a list of your favorite team rankings.

Survey to provide preferences of the teams based on your research interests.

After the preference is provided for some number of teams (depending on location and time of the interview), the interviewer will schedule interviews based on the feedback team managers to have after referring to your resume. Based on this feedback, my recruiter scheduled two team matching calls for me from my first and third priority teams.

An email with the team matching calls.

Preparing for team matching rounds

A general team matching interview call will have the following structure:

5–10 mins: Intros/ Interviewer Team Overview

25–30 mins: Research Experience / ML Design Questions

5–10 mins: Q&A

Since this is a machine learning position, you’ll be expected to know the basics of Machine Learning, Data Science, Probability Statistics, and your research area (for eg. Computer Vision). There is a very high chance that you’ll spend 45 mins of your interview just discussing your resume, related projects, and the interviewer will be pondering on the potential projects you might be interested in working on, in case you end up joining the team. But you should be prepared for any design and basic ML questions which might come in your way, for example:

Why did you evaluate your XYZ system with method A instead of method B?

So I did spend some amount of time revising my courses and prepared the revision notes which you can refer to from the links listed below:

But for the most part, I focused on revising my projects, papers, and preparing for potential questions and reasonings that could follow up in the discussion.

November 10th: Team Matching Interviews

My experience with two team matching interviews was great, you get to know the teams and your potential manager. For me, both the interviews were much less technical than the coding rounds, and the focus of conversations was solely on getting to know me better. We discussed my research interests, project, current projects the teams were working on, and the potential projects that I could be a part of. In the midst of these questions, there were instances where you had to explain the technical details of the tools you used in your papers/projects, so make sure to cover that before the interview. And it was just 45 mins per call, so time just flew by. The whole point of these interviews is not to reject you, but to come up with good potential projects that you can take as an intern which are both relevant to you and the team. In case you don’t match with the teams for some reasons (you don’t want to join the current teams after interviewing, or the manager couldn’t find any good potential projects), there might be further rounds with other teams from the list you provided, but that’s not guaranteed according to Facebook’s terms and conditions.

November 12th: Offer Letter

I got the call from my recruiter two days after the interview, asking about my preference over the teams I would like to join after the team matching rounds. This preference is then matched with the interview feedback they have for me from both the teams. This is used to decide whether or not you passed the team matching rounds, it’s pretty subjective. Since my first preference team, after the interviews had accepted me as an intern candidate, I successfully matched with that team.

Things I could have done better

I took a lot of time ~2 months to schedule my coding rounds. Though that time was required to practice the questions, I could’ve got more options with the teams if I had cleared the coding rounds a bit earlier in the hiring cycle. It is important to note that the choice of teams that are given to you keeps shrinking with time as more and more teams get their positions filled in the meantime.

Conclusion

And that’s it about my whole experience with the interview process. It’s more focused on your coding skills since the purpose of this internship is to scale the existing Machine learning algorithms to Facebook’s large infrastructure, and not to write papers discovering new techniques. I was really surprised to know how hard it becomes to apply even trivial ML algorithms to the scale on which Facebook functions.

Make sure you practice hard and keep calm during the whole process, things will eventually work out. Good Luck!