FB Prep Handbook
FB Prep Handbook
Initial Interview
Guide
Welcome to your prep guide for your machine learning (ML) initial interview
What You’ll Find at the Facebook company. Our ML engineers and recruiters put together
in This Guide
this guide so you know what to expect and how to prepare.
Time
Interview overview
Prep guide for your
Time
initial screen
How much time can you expect to prep for and take your initial tech screen?
What success looks like
Prep Time
11 Tips for your initial screen
Start your prep early. Before your interview date, be sure to spend time practicing your coding,
Appendix / resources
algorithmic, and problem-solving skills.
45 Minutes to Interview
Your conversation with an engineer will be divided into the following time blocks:
• Introductions: 5 minutes.
Let’s get to know each other. We’ll talk about us and you’ll talk about who you are,
where you’ve trained and worked, and what your areas of expertise are.
• Coding: 35 minutes.
Solve one or more coding problems focused on computer science fundamentals like
algorithms, data structures, recursions, and binary trees. If your tech screen is by phone,
the engineer will send you a collaborative editor (such as CoderPad).
• Your Questions: 5 minutes.
Take this brief opportunity to learn more about working at Facebook from an
engineer’s point of view. Think about what you find interesting and challenging about
the work you’d be doing.
Interview overview
How is your initial tech screen structured?
Your interview will be by phone with an engineer, and you’ll be coding remotely on CoderPad,
so make sure you’ve practiced using it to code. Also, check your tech so it’s solidly operable—
fully charged, good internet connection, and hands-free.
1
The interview is formatted to see how candidates can quickly come up with the most efficient
solution to a problem in their head first, and then quickly code it without logic flaws. You’ll need
to think of corner / edge cases before and while you code, then check your code at the end.
The coding problem is worked out by hand on the digital whiteboard so the interviewer is able
to see your thought process and collaborate with you.
Content
The content of the screen could cover a variety of topics, but generally interviewers want to
assess your ability to develop original software in a short period of time. Interview topics may
cover anything on your resume, including:
Critical
Data Structures: Algorithms:
• Arrays and lists. • Search: iterator, binary, hash.
• Binary trees. • Sort: merge, quick, bucket.
• Hash tables. • Graph traversals: BFS, DFS.
• Stacks and queues. • Complexity, Big O notation.
• Graphs. • Recursion.
Nice to Have
Data Structures: Algorithms:
• Trie. • Randomized quicksort.
• Heap. • Heap sort, radix sort.
• Set. • Spanning tree, minimum cut.
• Red-black trees.
We may pose some of the coding problems as an ambiguous, real-world problem, and we’ll
ask you to interpret the problem and apply your knowledge to find a solution. You’ll need to
interpret the coding knowledge that you have for that particular situation. Interviewers are
looking for insight into your thought process, creative solutions, ability to work out more than
one way to solve a problem, and ability to talk through your rationale for choosing a certain way
to approach solving the problem. So, you could perhaps recommend an algorithm, code up a
solution using that algorithm, analyze the runtime of your code and then optimize your solution.
2
• Familiarize yourself with key data structures and algorithms.
Really important structures include (but are not limited to) lists, arrays, hash tables, stacks,
queues, graphs, various flavors of trees and tries, and heaps. Knowing about balanced trees
couldn’t hurt. It’s really important to know about major types of sorts (mergesort,
quicksort, radix sort, etc.), searches, and traversals (BFS, DFS). Knowing how to find a
spanning tree or a minimum cut could be nice to have. Be able to discuss the Big O
complexity of your approaches. Definitely know when and when not to use recursion.
• Focus on talking through your logic.
Your reasoning is important. Engineering is all tradeoffs. Be able to discuss those.
More specifically…
To get a deeper sense of what we mean, visit our Facebook Engineering Interview Prep pages
to see what tips engineers have for initial and onsite interviews.
Prep exercises
Take these actions to test your knowledge:
1. Review this diagram to break down interview questions.
2. Study the data structures. This guide will give you an overview of how to implement
each one. Your goal should be to know how to code these out.
3. Read the book Cracking the Coding Interview. You’ll start to notice the solution
rotates around recursion and a data structure.
4. Practice real questions online like LeetCode Regular Problem Sets. Attempt to solve
medium and hard problems. You should be able to consistently get through medium
to hard problems within 40 minutes and at an optimal complexity.
5. T
here is no need to learn or know how to do dynamic programming or
memorization.
1. Avoid misunderstanding.
When we ask you to provide a solution, first define and develop a framework of the
problem as you see it. Ask for help or clarification and spend two to five minutes
asking the interviewer about corner cases on the problem. This will ensure that you’ve
understood the problem correctly.
4. Hints.
If your interviewer gives you hints to improve your code, please run with them.
8. Clarifying questions.
Make sure you’re asking clarifying questions as you go along (there won’t be tricks but
ensure you have all the info you need).
4
10. Questions.
You’ll most likely have some time at the end for questions for your interviewer. Some
people find it easier to come up with a few questions in advance rather than think of
them on the spot.
11. Cancelling.
Don’t hesitate to cancel if something comes up. If you won’t have a quiet space, a good
internet connection, and a good phone connection, or you had to stay up all night with
a sick child or broken system, please reschedule. We want you at your best and will be
happy to move your interview to a better time.
Appendix / resources
Links to exercises, information, and guides to help you prepare
For your initial tech screen, our engineers collected some helpful resources with content
and activities. Take a look through the list as you prepare.
Coding questions
• C
areerCup: Archive of interview questions by the author of Cracking the Coding
Interview.
• Glassdoor: Archive of interview questions and reviews of interviews.
• Project Euler: Coding problems, but not interview questions.
• GeeksforGeeks interview questions
• Cracking the Coding Interview
• CodeChef
• Use CodeRunner App, an editor to practice your algorithms.
• To study runtime complexity, use Big-O Cheat Sheet.
5
Video Prep Guides for Tech Interviews
• How to Crush Your Coding Interview: A video about how to prepare for
programming interviews at Facebook.
• Cracking the Facebook Coding Interview: The Approach (password: FB_IPS).
• Cracking the Facebook Coding Interview: Problem Walk-through (password:
FB_IPS).
• A video discussing what to expect during your interview.
Helpful books
• C
racking the Coding Interview by Gayle McDowell. Best-known and best-selling book
about software interviews.
• I ntroduction to Algorithms by Cormen, et al. The classic textbook on algorithms and
data structures.
• Elements of Programming Interviews: The Insiders’ Guide by Adnan Aziz.
• Programming Pearls by Jon Bentley. Not about interviews, but a fun book about
programming tricks.