Advice > Software engineering

Coding Interview Prep for FAANG (7 steps to an offer)

By Tom Parry with input from the following coaches: Taru J . October 10, 2023
coding interview prep

We've helped thousands of candidates ace their coding interviews at FAANG and other companies, and we can confirm that preparation is everything.

Want to practice coding problems right now for free? Sure, you can do that on FreeCodeCamp or another site.

But remember, working through lots of Leetcode-type problems on your own is NOT enough.  That's because there's a lot more to FAANG coding interviews than just coding.

Below, we've laid out the seven key preparation steps you'll need to take to succeed. Follow them, use the resources we link to, and give yourself the best possible chance of getting an offer at Google, Meta, Amazon, or elsewhere.

Here are the seven steps to take to prepare for your FAANG interview.

1. Own the process
2. Learn a consistent answer method
3. Refresh on data structures and algorithms
4. Practice solving example questions
5. Improve your coding interview skills
6. Consider using books and courses
7. Practice with mock interviews

Use this guide as a launchpad for all your FAANG coding interview prep. When you need to go deeper into a topic (answer methods, data structures, algorithms, questions, mock interviews, etc.) just click on the relevant link.

Let’s go!

Click here to practice coding interviews with ex-FAANG interviewers

1. Own the process

Before you get down to the nitty-gritty of coding practice, it’s worth doing some quick reading to understand what kind of hoops you’ll be jumping through.

1.1 What is a coding interview like?

Coding interviews at FAANG companies tend to last around 45 minutes.

You'll probably be asked to code in a specific app that the company uses for coding interviews. If it's an in-person interview, you'll be given a laptop to do this on. It's now quite rare for candidates to have to write code on a whiteboard, as used to be common at Google, Facebook, etc.

However, don't be fooled into thinking that your interview will be similar to solving problems on platforms like Leetcode. One of the most important aspects of a coding interview is collaboration, and so ideally it should feel like a conversation. You’ll be expected to talk through your solution with your interviewer and include them in your thought process.

You can also expect “trivia” type questions that test your knowledge about an area of coding, rather than asking you to solve a problem. These are most common in the early rounds, as the recruiter or hiring manager tries to get a sense of your level of expertise.

As well as coding problems and questions, you may face behavioral or cultural fit questions at the beginning or end of a coding interview.

1.2 How many interviews will I face?

That depends on the role and company you’re interviewing for. Software engineers usually face one or two technical screens involving coding questions as part of the early rounds, before 3 coding interviews at the onsite stage. Engineering managers and data scientists will usually face just one coding interview at the onsite stage.

Refer to our specific guides for each role and FAANG+ company to get the exact breakdown of what you can expect from the interview process, including the exact number of interviews and what type of questions you can expect in each.

1.3 When should I start preparing?

This obviously depends on many factors, such as how good at coding you are already and how quickly you learn things. However, using engineers who we helped get offers as a benchmark, we estimate that the median preparation time for a FAANG interview is around 100 hours.

If you don’t have a full-time job, you may be able to fit your preparation into a few weeks. However, most of the candidates that use our coaching service already work full-time, so they spread their workload over a couple of months or more.

They also told us that studying at least an hour or two every day was much more efficient than irregular bursts.

1.4 Which language is best to use in FAANG coding interviews?

The big tech companies all say that in the interview, you should code in whichever language you feel most comfortable using. More than anything, they want to see your clarity of thought and your problem-solving abilities, and it doesn’t matter what coding language you do this in, as long as it’s a language that’s known to a wide audience.

However, if you’re comfortable writing code in various languages, you’ll have to weigh up various factors when you’re choosing which to use.

Java, Python, and C++ all have the advantage of being widely used at FAANG companies, which makes them a common choice for candidates.

Python has the advantage of being very efficient to write compared to Java and C++, and many candidates say this saves time in interviews. However, Java has the advantage of being a “real” (compiled) language rather than an interpreted language and some people say this may impress your interviewer.

Whichever one you choose to use, just make sure you’re comfortable in it and have been using it for a good few months before the interview.

2. Learn a consistent method

The problems you can expect to face in your coding interview are highly ambiguous and can usually be solved in many different ways.

To guide and structure your thinking, you’ll therefore want to use a consistent answer framework that you can apply to each question.

One of our favorite approaches is summarized in the following video from Amazon:

 

Here is a summary of the approach:

Five-step approach to coding interview problems

  • Step 1: Clarify
    • Ask clarification questions to remove ambiguity about the problem
    • Explore the edges of the problem
  • Step 2: Plan
    • Discuss potential approaches you could take
    • Pick an approach and lay out the high-level steps
  • Step 3: Implement
    • Write clean code, not pseudocode
    • Comment on your code as you go
  • Step 4: Test
    • Start by testing with a simple example
    • Try breaking your code with edge and corner cases
  • Step 5: Optimize
    • Calculate time complexity
    • Discuss how you can optimize your solution

We strongly recommend you explore this framework, and our detailed version of it, by reading our article on how to answer coding interview questions. It's got a written example answer that will show you how to apply the framework, minute-by-minute, in your interview.

Using this framework will give you a structure that you can use to show your problem-solving skills and, of course, your coding knowledge, which we’ll move on to now.

#Expert tip

"Don't ignore the psychological aspect and the role that nerves can play. Often, people have done the prep and practiced loads of problems, but then they bomb the interview because of nerves.

Doing mock interviews can reduce this but I think it's important to go into the interview ready with some basic techniques to calm the mind. It can be as simple as taking deep breaths, focusing on incoming and outgoing breathing for a few minutes, or getting some fresh air before the interview. Plus, don't underestimate a good night's sleep!"

Taru, software engineer at Meta and interview coach

3. Refresh on data structures and algorithms

Below we've provided a short overview of the most important data structures that are used in coding interviews. For each one, we've also included a link to a separate resource that provides a deep dive into that topic. You might want to skim this list, skipping the topics on which you're already clear and selecting the ones you want to refresh on.

3.1 Refresh on data structures

3.1.1 Arrays

An array is a list-like data structure that contains a collection of values, each associated with a specific index, usually with a fixed overall size. Arrays are one of the most fundamental data structures in programming and computer science, and many more complex data structures are built using arrays. The array itself is not always as simple as it might seem, and it forms the basis for many tricky interview questions.

Array basics.

3.1.2 Strings

A string is an ordered sequence, or string, of characters. It is usually considered a data type and is often included as part of language primitives. In most languages, strings are implemented using an array of bytes. The bytes are encoded using some character encoding. Earlier systems used ASCII encoding, with Unicode encoding used in later systems.

String basics.

3.1.3 Linked lists

A linked list is a data structure used to store a collection of data elements. In this way, it is similar to an array. However, unlike an array, the data elements in a linked list do not need to be stored contiguously in memory. Rather, each node in a linked list has a pointer or reference to the memory location of the next node in the list. This means that linked lists do not have a fixed size like arrays, and can easily grow and shrink as elements are added or removed.

Linked list basics.

3.1.4 Stacks and queues

Stacks and queues are similar and complementary in many ways. Both are a sequenced collection of elements that are generally accessed one element at a time and are implemented using similar data structures. 

Stacks are Last in First Out (LIFO) constructs. Queues are the opposite, being First In First Out (FIFO) constructs. These characteristics are what give these structures their name. A stack is analogous to a stack of physical objects, for example, a stack of plates or chairs. The last plate or chair added to the stack is usually the first one removed when an item is needed. Similarly for a queue, the first person to enter a queue is usually the first person served.

Stacks and queues basics.

3.1.5 Graphs

A graph is an abstract data structure represented by vertices connected by edges. Vertices are also known as nodes. Vertices sharing an edge are known as adjacent.

In directed graphs, sometimes called digraphs, the edges between nodes have a direction attribute to show which way a relationship between two nodes goes. Non-directed graph edges have no direction, meaning the relationship goes in both directions.

Graphs basics.

3.1.6 Trees

A tree is an abstract hierarchical data structure. It is represented by a group of linked nodes, with a single root node. Each node can have zero or multiple children. A leaf is a node with no children.

Trees basics.

3.1.7 Maps

A map is a data structure that allows us to access a value by key. This is in contrast to an array that allows us to access a value by index. A common kind of map is a hash map (also called a hash table), which stores keys along with associated values (for example, a telephone directory, which associates phone numbers with names).

Map basics.

3.1.8 Heaps

A heap is a tree-based data structure that implements a priority queue. A priority queue functions much like a regular stack or queue, except that each element has a priority. It is this priority that determines which element is returned when dequeuing from the priority queue, rather than the order in which the element was added. This is useful for applications like a hospital queue where we want to serve the patient with the highest priority first.

Heap basics.

3.2 Refresh on algorithms

Of course, you'll also need to know your algorithms. Below, we've listed the most relevant ones for coding interview questions. As with above, you can skip the topics you're already confident on, and just click the link on the ones you want to study in more detail. 

3.2.1 Depth-first search

We can categorize all data structures into two categories: Those with a simple option for visiting each item, and those with multiple, complex options for visiting each item. Data structures like arrays, lists, stacks, and queues fall in the first category – we can easily visit each node in an array by traversing over the array indices; following each link for a list; popping from a stack; and dequeuing from a queue. However, for a tree or graph data structure, it is not so simple.

A depth-first search (or traversal) is an option for visiting all the nodes in a tree or graph. In a depth-first search (DFS), we visit child nodes first before siblings.

Depth-first search basics.

3.2.2 Breadth-first search

Breadth-first search (BFS) is one traversal method for trees and graphs in which all vertices on one layer are visited before visiting their children on the next layer – i.e. every node on layer i is visited before the nodes on layer i+1.

Breadth-first search basics.

3.2.3 Binary search

Binary search is one of the fastest search algorithms because it halves the search space with each iteration. Binary search requires an ordered set that also has constant access times. This means that, of all the basic data structures, only sorted arrays are suitable for binary search.

Binary search basics

3.2.4 Sorting

Many algorithms require, or perform better on, a sorted dataset. Take searching as an example: to search an unsorted dataset of 1,000 items means looking at all 1,000 items in the worst case. In contrast, using binary search on a sorted dataset of 1,000 items means looking at 10 items in the worst case. For a bigger dataset of 1,000,000 items, searching it as unsorted is looking at 1,000,000 items at worst, but searching it as sorted is looking at 20 items at worst. Being able to sort data effectively can therefore yield returns later in an algorithm.

Sorting basics.

3.2.5 Dynamic programming

Dynamic programming is an algorithmic paradigm to create optimal solutions for complex problems by breaking them down into simpler sub-problems that can be solved recursively.

Dynamic programming basics.

3.2.6 Greedy algorithm

A greedy algorithm is an algorithmic paradigm that finds the optimal solution to a problem by breaking the problem down into smaller (local) parts and finding the best solution for each of these parts.

Greedy algorithm basics.

3.2.7 Backtracking

Backtracking is a form of brute-force problem solving but with the ability to discard potential solutions early, before they are fully explored. It is an algorithmic paradigm for incrementally finding solutions to problems. As soon as a candidate route will not result in the final complete solution being valid, the algorithm will “backtrack.” Therefore, backtracking can be applied when it is possible to test the validity of partial solutions.

Backtracking basics.

3.2.8 Divide and conquer

Divide and conquer (DAC) is an algorithmic paradigm used to solve problems by continually dividing the problem into smaller parts until a part is easy enough to solve (conquer) on its own. The solutions to the solved parts are then combined to give the solution for the original problem. For optimization problems, being able to build an optimal solution based on the optimal solution of smaller parts is known as an optimal substructure.

Divide and conquer basics.

3.3 Refresh on Big O notation

To impress in a coding interview at a top tech company, you’ll need to show a good understanding of Big-O.

Big-O is a method of analysis used to measure an algorithm’s performance in terms of certain properties. When we design algorithms, we need to pick the algorithm that best meets our time and space constraints. Big-O provides us with a simple expression we can use to analyze and compare algorithms.

Big O basics.

4. Practice solving example coding questions

Once you’ve refreshed your knowledge of data structures and algorithms, you’ll want to start practicing. Candidates who train with us usually practice hundreds of questions before their interview.

4.1 Data structure questions

So that you can see which data structures you most need to focus on, we recommend you start by going through the problems in our data structure questions article. You’ll find 9 example questions (with solutions) on each of the key data structures:

73 data structure interview questions (with solutions and cheat sheet)

When you want to practice more on a certain topic, just choose from the list below. We’ve arranged the questions by difficulty level (easy/ medium/ hard) so that you can quickly get a sense of what level you’re at:

  1. 50+ array questions with solutions
  2. 50+ string questions and solutions
  3. 40+ linked list questions with solutions
  4. 50+ stacks and queues questions with solutions
  5. 50+ graphs questions with solutions
  6. 50+ trees questions with solutions
  7. 50+ map questions with solutions
  8. 50+ heap questions with solutions

4.2 Algorithm questions

As with data structures, we recommend starting with our reduced list of algorithm questions, so that you can pinpoint which ones you need to improve on most:

71 algorithm interview questions (with solutions and cheat sheet)

When you’re ready to focus on a specific algorithm, just click on one of the articles below. Again, to help you measure your progress, the questions are organized into easy/medium/hard.

  1. 50 depth-first search interview questions
  2. 44 breadth-first search interview questions
  3. 50 binary search interview questions
  4. 54 sorting interview questions
  5. 53 dynamic programming interview questions
  6. 50 greedy algorithm interview questions
  7. 47 backtracking interview questions
  8. 50 divide and conquer interview questions

4.3 Google coding questions

Testing yourself by answering questions from recent Google coding interviews is a great way of gauging your level, regardless of whether you're actually targeting the company.

Google has shared a bunch of practice questions here, complete with helpful hints, explanations, and solutions. You can also find questions asked at Google Meta, and Amazon interviews in our FAANG interview questions and answers guide.

Google also offers this helpful mock interview video as an example, which is again worth watching irrespective of the company you're targeting.

 

4.4 Coding interview examples

Watching mock coding interviews on YouTube can be an excellent way to gauge your readiness level and get used to seeing how interviews play out.

Below are some examples to get you started.

4.4.1 Python coding interview examples

4.4.2 Java coding interview examples

4.4.3 C++ coding interview examples

4.4.4 JavaScript coding interview examples

Watch many more mock interviews in our more comprehensive list of 47 coding interview examples. We recommend working through the problems yourself as you watch, pausing the videos if necessary.

5: Improve your coding interview skills

There are plenty of engineers who can solve most coding problems on their own but end up failing their FAANG interview. Why? Because their interview skills are not up to scratch.

With the help of two interview coaches (who have conducted 300+ real and mock interviews between them), we put together a list of 21 tips for coding interviews. We’ve included 5 of them here to give you a snapshot of the sorts of things you can do to up your coding game:

5 coding interview tips

#1 Don’t jump straight to coding

If you start writing code immediately after you hear or read the question, this is a huge red flag to your interviewer. For many interviewers, a candidate’s collaboration and communication skills are just as important, if not more important, than a candidate’s technical capabilities.

So, jumping into your answer without asking clarifying questions or discussing possible approaches with your interviewer signals that 1) you haven’t thought through the answer, and 2) you won’t collaborate with your interviewer. Both are bad signs for how you will work with the team that you are applying to join.

#2 Break the problem into smaller tasks

The types of coding questions that are asked in tech interviews can typically be broken down into 2-5 tasks that will each take a few minutes to complete. While you’re making your plan, list out these small steps and explain them to your interviewer.

As you work, cross out each of these steps one by one, and tell your interviewer (e.g. “I have completed task X, and now I will work on Y, then Z.”). This will give you a confidence boost each time you finish a smaller task. It will also give the interviewer a sense of how you will be able to tackle long-term, difficult projects on the job.

#3 Use pseudocode to explain your thinking

Interviewers want to understand how you think. When you’re explaining how you’re going to approach a problem, writing pseudocode is an excellent way to outline your plan and show your work to the interviewer.

#4 Proactively acknowledge tradeoffs

Any decision you make will have a tradeoff. So call them out in real-time. Use it as an opportunity to discuss different options with your interviewer and explain why your choice is the best one. If you don’t bring up tradeoffs, your interviewer will almost certainly ask about them. So it’s better to beat them to it.

#5 Listen for subtle hints

If your interviewer tries to steer you in a direction, follow them. 99% of interviewers have good intentions, and they're trying to help you.

For more detail on these tips, plus lots more, read the full article: 21 coding interview tips. 

6. Consider using books and courses

With the links we’ve provided in this article, you’ve already got the bulk of the preparation resources you need. But sometimes you’re probably going to want to go deeper and really study something inside out. That’s where books and courses can come into their own.

Here’s a brief list of some of our favorite books and courses:

For coding, there’s obviously Cracking the Coding Interview by Gayle Laakman McDowell, the overwhelmingly popular choice and still as relevant as ever.

We also recommend this video of Gayle going through a problem at Facebook, which is definitely worth a view as you hone your answer method.

 

If you feel like you need to do a course, Educative does great courses on coding and system design. We’ve also had candidates tell us good things about AlgoExpert.

For the system design part of your interview, we recommend starting with our guide to system design interview prep.

If you then want to go deeper, System Design Interview: An Insider’s Guide by Alex Xu, has been recommended to us by a lot of candidates.

(We don’t earn anything from these links, we just like to pass on good recommendations.)

7. Practice mock coding interviews

One of the main challenges of coding interviews is that you have to communicate what you are doing as you are doing it. Having to think, code, and communicate your thoughts to the interviewer all at the same time is not easy.

With that in mind, don't let the first interview you do be the real thing. Instead, we highly recommend getting some mock interviews under your belt.

7.1 Practice with peers

If you have friends or peers who can do coding mock interviews with you, that's an option worth trying. It’s free, but be warned, you may come up against the following problems:

  • It’s hard to know if the feedback you get is accurate
  • They’re unlikely to have insider knowledge of interviews at your target company
  • On peer platforms, people often waste your time by not showing up

For those reasons, many candidates skip peer mock interviews and go straight to mock interviews with an expert. 

7.2 Practice with experienced coding interviewers

In our experience, practicing real coding interviews with experts who can give you company-specific feedback makes a huge difference.

Find a coding interview coach so you can:

  • Test yourself under real interview conditions
  • Get accurate feedback from a real expert
  • Build your confidence
  • Get company-specific insights
  • Save time by focusing your preparation

Mocks are also extremely useful for the other types of interview rounds you’ll be facing, such as system design and behavioral.

Landing a job at a big tech company often results in a $50,000 per year or more increase in total compensation. In our experience, three or four coaching sessions worth ~$500 make a significant difference in your ability to land the job. That’s an ROI of 100x!

Click here to book coding mock interviews with experienced FAANG interviewers.
 

 

Related articles:

Dynamic programming interview questions
Software engineeringNov 22, 2021
53 dynamic programming interview questions [easy, medium, hard]
53 dynamic programming interview questions, all with links to high-quality solutions, plus an interview preparation guide. Part 5 of our algorithms questions series to help you practice for your software engineer interview.
Read more
Hand holding phone displaying Google Maps route
Software engineeringNov 14, 2022
Google system design interview guide (questions, process, prep)
Everything you need to know about Google system design interviews, including the process, 45 sample questions, example answers, and an answer framework.
Read more
Amazon software development manager interview
Software engineeringNov 16, 2022
Amazon SDM interview (questions, prep, process)
Complete guide to Amazon software development manager interviews (also applies to AWS). Learn the interview process, practice with example questions, and learn key prep tips.
Read more
people management primer for tech interviews
Software engineeringFeb 16, 2023
People management primer for tech interviews (competencies, questions, resources)
Demonstrating people management skills key to the interview process for managerial roles at companies like Amazon, Meta, and Google. We provide you with the top people management competencies, lists of practice questions, and an interview preparation plan.
Read more
Google interview process
Software engineeringFeb 15, 2023
7 steps of Google's interview process (and how to ace them)
Complete guide to the seven steps of Google's interview process, including detailed insights and links to key preparation resources for top Google roles.
Read more
man at table waiting to be asked Meta interview questions
Software engineeringSep 18, 2024
Top 5 Meta Interview Questions 2024 (with Answers)
Comprehensive list of Meta interview questions for engineering candidates at Meta. Real examples of coding, system design, and leadership questions recently asked at Meta, with answers and frameworks to help you practice.
Read more
Googler displaying Googleyness by drinking a coffee
Software engineeringAug 17, 2023
Googleyness & Leadership Interview Questions (+ how to impress)
Learn what Googleyness actually is, what kind of questions to expect and how to demonstrate Googleyness and leadership throughout your interviews.
Read more
Facebook logo
Software engineeringFeb 16, 2023
Meta Front-End Engineer Interview (questions, process, prep)
Complete guide to Meta (formerly Facebook) front end engineer interviews. Learn the interview process, practice with example questions, and learn key preparation tips.
Read more