0% found this document useful (0 votes)
44 views3 pages

Facebook Coding Interview Prep Guide

Uploaded by

Jay Rel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views3 pages

Facebook Coding Interview Prep Guide

Uploaded by

Jay Rel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Meta Coding Interview - Prep Notes

Please note that for the Coding Interview - Execution is Disabled on CoderPad so there will be
no live testing of the Code.

Language:
As there are many different programming languages used at Facebook to solve infrastructure
challenges, we don't prefer the language (or languages) you use during the interview. We think that if you
can show us solid programming skills in one language, you'll be able to transfer them to other languages.
At least one of the problems we ask you will require that you use something other than shell scripting
(bash/zsh/etc.). We've ended up hiring candidates who have done their phone screens in virtually every
modern programming language, including Python, PHP, Perl, Ruby, Java, C++, C, Go, C#, and Haskell.

5 Tips to Focus On (From a FB Production Engineer)


Can you code in some language, do you understand data structures and algorithms, are you writing code
defensively and do you know how a program interacts with a system.
1. Algorithmic complexity (basics of big O notation), opening and reading files, data structures (hash
tables), scaling issues (size larger than memory, etc.). Great to know things like Arrays, Linked
Lists and Strings.
2. Data manipulation, handling input / output, automating tasks, interfacing with external systems /
processes, etc. The questions can be a real problem, or something contrived to use these skills.
3. Pay attention to edge/corners cases, bad inputs, failures, exceptions, check for bugs, if you are
unsure how far to go, just ask the interviewer.
4. It's important that the code can run. In production you are dealing with real time incidents that
need to be taken care of during the time.
5. Behaviorally, ask clarifying questions, walk through your solution out loud and help
the interviewer understand your thought process.

Types of Questions Asked


The questions we ask require skills used every day by Production Engineers (and Systems /
Operations / Infrastructure Engineers), including text manipulation, handling input / output, automating
tasks, interfacing with external systems / processes, etc. The questions can be a real problem, or
something contrived to use these skills.

Tips to Keep in Mind While Preparing for Coding

• You'll receive 2 coding problems within this 1–45-minute interview. Please try to get as close to
finishing both as you can. That's around 20 minutes a problem.
• Ask a couple clarifying questions before you begin each problem! This is a great way to ensure
you don't start coding the wrong direction and it shows that you're taking the time to fully
understand the problem. Make sure you leave enough time to solve the problem!
• Get in the habit of thinking out loud. They love to hear your thought process. They could provide
you with a few hints to help you get to the solution. Use their hints to your advantage, but of
course try to keep them to a minimum if you can.
• TIME YOURSELF when preparing. The interview is 45 minutes long. The interview will have two
coding questions in it. Try completing 2 problems within 45 minutes as many times as you can.
Using LeetCode or HackerRank should be extremely helpful for those coding questions.
Additional Preparation Thoughts:

• The best way to prepare for coding interviews is to practice under similar circumstances by
yourself or with a friend, using sample questions. A coding phone screen is an unnatural
event, even if you are used to coding regularly for your job. The problems are different, the
environment is different, and you are under time pressure.
• Choose at least one language and know the basics solidly. It is better to know one language
well than multiple languages poorly. This includes creating classes and methods, conditional
constructs, loops, built-in data structures, input/output, and interfacing with external
processes/systems. Be prepared to use this language to solve any type of problem you may
get.
• Consider practicing by trying similar coding exercises here: [Link]

Interview Tips

• Your primary goal in the interview is to obtain a working solution to each problem in a
reasonable amount of time.
• Make sure you are in a quiet place with a reliable internet connection. Headphones are very
handy. A speakerphone also usually provides acceptable sound quality. Holding the phone in
your neck for 45 minutes while you try, and type is going to be a pain. Close your email and
chat apps to avoid interruptions.
• We will always paste in the text of any coding question we ask you. Take some time after
reading the question to ask questions and plan out your solution, rather than jumping right
into its implementation.
• Make sure you utilize a working solution first before optimizing (done is better than perfect)
• Pay attention to edge cases, corner cases, bad inputs, failures, exceptions and make sure to
check for bugs
• While you don’t need to provide a play by play of your thought process throughout
the interview, it’s best to let the interviewer know why you are making certain decisions and
do most of your work in the CoderPad window. This will also help with any course corrections
that may be needed while you are solving the problem.
• Take hints from the interviewer and be open to other solutions as you go. It's totally fine to
present a rough solution in the beginning and iterate as you go along.
• Use the language you are strongest in. Don't use a language you know less well because it's
trendy or you think it will please the interviewer. If the interviewer doesn't know your
strongest language, they will figure it out later.
• Don’t be afraid to change your mind. If you think you’ve started your solution in the wrong
way, or even in the wrong language, it’s OK to admit it and change tack (and the sooner you
do it the better).
• Resist the temptation to look things up on the internet during your interview. We'd rather
have you get a function name incorrect or the order of arguments wrong than have you
looking things up during the interview. We want to see you write code and think on your feet,
not search the web.

Final Notes to Remember for Coding


• If it pertains to your language: You should brush up on your familiarity with common built-in
functions and libraries.
• Specifically with respect to complexity - It's good to know and explain the complexity of your
solution, but don't take too long or get hung up on trying to come to the most optimal solution
right away. It's much more important you get started getting something down right away, so we
have time to make improvements later.
• It's ok for your first pass at a problem to be a bit messy, but before finishing look through the
code you've written and try to clean it up and simplify it.
• Don't spend too long writing pseudocode before starting with real code. Don't spend to long
planning your solution before attempting it.
• Pay attention to edge cases, corner cases, bad inputs, etc. and check for bugs
• If unsure about anything regarding the question- please ask the interviewer
• Gather all requirements before going into coding and ask the clarifying questions
• Think out loud so the interviewer can understand what you are trying to accomplish
• If you use a brute force solution- talk about how you would optimize it- so that it
is production ready code- (always the main objective)
• Have a good understanding of basic data structures.
• Write your Code Defensively
• It's better to code correctly than quickly, but walk through how you would do it if you run out of
time
• Be able to explain code in a practical way- be able to explain what the code is intended to do
• Pretend the interviewer knows nothing - walk them through your problem-solving step by step.
• Have some fun! You got this!

Coding Prep Videos (Please note that these are SWE Prep Videos, but still incredibly helpful for PE
Coding Interviews)
Video 1 - Please Watch - Cracking the Facebook Coding Interview - The Approach; Password = FB_IPS
Video 2 - Please Watch - Cracking the Facebook Coding Interview - Problem Walk Through; Password =
FB_IPS

You might also like