You are on page 1of 10

FAANG Study Plan

Companies Difficulty Tiers

Tier-0: ByteDance, Citadel and/or HFT firms, Palantir


Tier-1: Google, Snap, Netflix
Tier-1.5: Facebook
Tier 2: Amazon, Twitter, Microsoft, LinkedIn
Tier 3: Cisco, Oracle, Yahoo, Walmart, GE, Workday SAP, Intel, Adobe, IBM, Intuit, eBay,
PayPal, Juniper, Citrix, Zillow, Redfin, Compass, Nordstrom, T-Mobile, etc.
Tier 4: Anything else

ALGORITHM TOPICS TO COVER

(A number after a topic is indicating tier N and above. If not, assume all tiers.)

Data structures
1. Linked List
• Doubly Linked List (3)
2. Map
• Regular Hash Map
• Tree Map (2)
3. Stack
• Regular Stack
• Mono-Stack and its techniques (2)
4. Queue
• Regular Queue
• Deque (3)
5. Binary Tree
• Regular Binary Tree
• Binary Search Tree (3)
• Balanced Binary Search Tree (Red-Black, AVL) (1)
6. Priority Queues (Max/Min Heap) (3)
7. Disjoint Set Union-Find (3)
8. Special Trees
• Fenwick Tree (1.5)
• Segment Tree (1.5)
• Trie (2.5)

Algorithms/Techniques
1. Greedy
• Quick Sort
• Merge Sort
• Bubble Sort
2. Bitwise operations (2)
3. Sliding Window (3)
4. Topological Sorting (2)
5. Graph algorithms
• Dijkstra (2)
• Kruskal/Prim MST (Rare. 2)
• Tarjan (1)
• Depth First Search (DFS - 3)
• Breadth First Search (BFS - 3)
6. Two Pointers (3.5)
7. Rolling-Hash Rabin-Karp (2)
8. Recursion/Backtracking
9. Binary Search
• Normal Binary Search
• Result Binary Search (3)
10. Dynamic Programming
1. Top Down (2)
2. Bottom Up (2)

Books to buy (for reference, or just PDF download.)

• Cracking the coding interview


• Elements of Programming Interview - Python
• Any algorithm textbook (CLRS ex)
• Web Scalability for Startup Engineers (for mid-senior interview)
• Design Intensive Data Applications (for senior interview)

Preparation Material:
• Leetcode
o Please buy Leetcode Premium.
• Youtube for system designs (senior interview)
o https://www.youtube.com/c/codeKarle
o Gaurav Sen
How I prepare myself from the interview
Background: I learn programming back in 2003 and has a background of competitive programming.
However, I stop practicing when I went to college. I joined Microsoft in 2014 and now have around 6.5
yoe. Currently I have a 5-month-old daughter and she’s my great source of motivation during this time.

Timeline

1. Recruiter reached out to me in mid-December. After being with Microsoft for bit long, I’ve
decided to give this a try
2. I’m fluent in c# but heard that Python is much easier and faster for interview, so I self-taught
myself Python to deal with the interview. As well as knowing another popular language will
give me much more options and opportunities anyway
3. With work going on, I spend around an 1-2 hour every day to work on 2-4 problems every
day. Starting with easy questions, and try out medium once I got ahold of things again
4. I took PTO at the end of Jan so I can focus 100% on practicing. That’s where I worked on
about 10-15 problems a day (mostly medium, 1-2 hard) for around 2 weeks. Then it’s a
share between Leetcode and System Design practicing

5. For system design, here’s my source:


• Grokking system design interview course
• System design primer on GitHub
• Design data-intensive application book
• Some Youtube channel such as Gaurav Sen, CodeKarle, etc.

Result

Amazon L5: rejected

Google E4: offer

Uber L5: offer, down leveled for L4

Facebook E5: Offer


Amazon:
Lots of Leadership Principle. Need to spend quite some time to learn this. They are looking for some
leadership skill and expect your story to be strong. They will go deep into your story, so make sure you
are not making things up or else it’s a red flag

Online assessment: Hacker rank (2 questions around leetcode medium) + never ending of behavioral
multiple choices

Onsite interview: 4 rounds. 3 coding and 1 system design.

1. Every round will start with 30 mins of leadership principle


2. Coding is fairly simple as you only have around 25-30 mins for coding and QNA
3. 1 coding will be with what Amazon calls a Bar Raiser. Not much compared to other coding
rounds
4. System designs will be fairly simple as well because of timing. You’ll still expected to come
up with the high-level designs, back of the envelope calculation and what is the core
components in your design

Sample coding questions for L5:

1. Given an array/list of words where a word can appear once or many times. Return the first
index of the word that appear once.
Follow up: imagine the input instead of a fixed/static array, is now a data stream. How
would you handle this? (think about it as query-based situation, where the stream can be
pause and your function is called)
Similar to this: https://leetcode.com/problems/all-oone-data-structure/
2. Write a function to reverse a string. Then for a sentence, revert each of the word in that
sentence
3. A specialized LinkedList is defined as a regular LinkedList with a list of random pointers to
other nodes. Given the root of a specialized LinkedList, clone that LinkedList.
Follow up: can you clone without extra memory?

Sample system design questions:

Design an analytic service for Amazon retail website so that leadership team / sale team can figure out
what is the best seller products for a particular time range
UBER
Note: Uber recruiter is slow, like terribly slow. Please make sure to keep emailing him/her for status

Online assessment: 1 hour, contains 4 questions (2 easy, 2 medium). Usually, the last question will be in
the form of a query question, where input is a list of queries. You can submit as many times as you like
in that 1 hour, and don’t feel bad if you couldn’t get the maximum score. Personally, I didn’t achieve the
maximum score either, but was sent to onsite

Onsite interview: 5 rounds. 3 technical rounds (1 will be system design), 1 with hiring manager (usually
some Behavior and some Coding), 1 Behavior

1. Every round will 1 hour long.


2. Coding is around leetcode medium. The difference is Uber is using codesignal as online IDE,
and will ask you to write code until it compiles as well as running test case correctly
3. Round with hiring manager is your chance to talk more about your background, strength
and weaknesses as well as ask more information about the team
4. System designs will be on the anywhere from easy -> hard, depends on the level you’re
applying. You are expected to come up with the high-level designs, back of the envelope
calculation and what is the core components in your design, as well as identify bottleneck
and how you address reliability/scalability. Interviewer will ask a couple of follow up
questions to make sure you understand what you talked about, so understanding deeper
than the surface level will be needed here

Sample coding questions for L5:

1. Similar to find the celebrity question on Leetcode https://leetcode.com/problems/find-the-


celebrity/
A node is considered a terminal node if all other nodes connect to it directly, and there’s no
outbound arc from it.
Given the number of nodes n, and a list of pair (u, v) that indicates an arc from u -> v, return
the value of the terminal node. If no such thing then returns -1
2. Write a function to reverse a string given start and end index.
Then write another function to remove the minimum invalid parentheses to make the string
valid
Write another function, given a string with valid parentheses, reverse the string within the
parenthesis
3. Design a function based on GO algorithm. Given the state of a board, and a coordinate (x, y),
decide whether the piece placed at (x, y) can be removed or not.
Follow up: What happen if machine memory is limited and cannot load the board, how can
you solve it using distributed system

Sample system design questions:

Design URL shortening service


GOOGLE
Note: Google recruiter is awesome and very responsive.

Online assessment/Phone Interview: I got lucky. Couple of friends in Google wrote up something nice
for me so Google skipped my phone interview.

Onsite interview: 5 rounds. 4 technical rounds and 1 Behavior

1. Every round will be 45 minutes long.


2. Coding is around leetcode medium/hard. From what I heard, Google tends to ban any
questions that got leaked outside, so it’s rare that you’ll see something on Leetcode in your
interview.
3. I heard from others that Google is notorious hard and if you cannot code the optimal
solution, you’re gone. But that is not always the case for me.
4. Also, since I’m applying for L4 in Google, there’s no System design. The recruiter did
encourage me to shoot for L5 but since Google is my target company, I tried to reduce the
risk.

Sample coding questions for L4:

1. Similar to this question on leetcode: https://leetcode.com/problems/sentence-screen-


fitting/
For this round I screwed up big time. I was too nervous and panic a little bit and that really
affect my thoughts as well as communication. I was able to come up with a solution, and
code up but wasn’t able to test all cases.
2. Similar to this question on leetcode: https://leetcode.com/problems/sliding-window-
median/
I wasn’t able to solve it using 2 heaps but was able to do it using SortedList. The interviewer
then asked a couple of follow up question regarding SortedList to make sure I fully
understand what I’m using.
3. Write a function to come up with the initial state of a board game, for example Bejewel,
Candy Crush, etc.
You’ll work with the interviewer to identify the valid state of the board and discuss how to
code up the initial state of the board. There’s a couple of follow up question as how to make
this better and more natural in a way (you don’t have to code it up)
4. Given a dictionary interface and a string, validate whether the string is reducible by
removing 1 character at a time until the string is empty. At any time, the string must be
valid, which means it must exist in the dictionary
FACEBOOK
Note: Facebook recruiter is awesome and very responsive. They would send you a good luck email
before your OA or Onsite

Online assessment/Phone Interview: It’s 1 hour. My experience is 1 leetcode easy and 1 leetcode
medium (https://leetcode.com/problems/single-number/ and https://leetcode.com/problems/word-
break/ )

Onsite interview: 5 rounds. 3 technical rounds, 1 System design and 1 Behavior

1. Every round will be 45 minutes long.


2. Coding is around leetcode medium/hard. I did around 220 questions on Leetcode that has
Facebook tag. Seems like from others’ experiences, Facebook coding round overlap a lot
with what’s on Leetcode, so definitely a good way to prepare
3. Interviewer told me that as long as I can solve 2 medium questions under 45 minutes then I
should be good. Also, for System Design I should be the one that drive the interview, the
interviewer will only ask question if needed

Sample coding questions for E5:

1. Behavior, same old story. With extra time available, he gave me a simple problem to warm
up. Given tax bracket % and salary, return the total tax for that salary
2. Two questions, similar to https://leetcode.com/problems/simplify-path/ and
https://leetcode.com/problems/regular-expression-matching/
I was lucky enough to look into the second question 1-2 days before the onsite or else it
would take me longer to complete this round
3. Similar to this question on leetcode: https://leetcode.com/problems/longest-substring-with-
at-most-k-distinct-characters/ and https://leetcode.com/problems/subarray-sum-equals-k/
4. Longest increasing path in a BST.
Follow up: longest increasing path in n-ary tree

Sample system design question:

Design Facebook Messenger. The interviewer definitely is more interactive than other company, will ask
more questions as well.
Interview process overview
A technical interview section mainly focusses on the following checkpoints:

1. Communications
2. Problem Solving skill

For communications, the interviewer will judge you based on the following:

1. Clarify your understanding of the questions.


1. Make sure you know what the input format/type will be. I’ve seen people mistook the input
of binary string vs list of 0 and 1
2. Make sure you know the actual requirement.
2. Identify limitation, like input limitation or memory limitation. Identify the core challenge early will
help your train of thought.
3. Identify edge cases and decide how that will affect your code/algorithm. It’s best to give out some
edge cases examples:
1. Array/String/List: empty, null, even length, odd length, …
2. Integer: positive, 0, negative,
Those edge cases can be used as part of your testing after finish writing your code as well.
4. The ability to express your train of thought, how you come up with the algorithm and how your
algorithm would address the edge cases in 3.
1. If you come up with a solution straight away without analyzing/clarifying anything, this is a
red flag as most likely you saw this question in the past.
2. Why explaining the algorithm, it would be good idea to write/type out some pseudocode.
This will help your implementation step as you can easily tell the interviewer which step in
the pseudocode you’re implementing. Pseudocode also would let you know early how you
would break down/structure your implementation
3. In a not so ideal situation where you couldn’t figure out the optimal solution, it’s also a good
thing to let the interviewer know which solution/data structure/algorithm you’re thinking of
using, why you have that idea and why it wouldn’t work.
5. Come up with a complete solution first and then think about trade-off/alternative later. You don’t
want to get into a rabbit hole and not have a working solution. You can talk all you want, but at the
end if you cannot lock in a solution, it all goes to waste.
6. Thinking and coding in silence do more harm than good. Try your best to speak up and if you’re
really struggle doing this, here’s a few tips:
1. Practice Rubber Duck debugging (https://en.wikipedia.org/wiki/Rubber_duck_debugging).
You’ll learn how to explain your algo/idea in the simplest way
2. Grab a friend and practice with each other. Pair programming works really well.

For coding parts, interviewer is usually looking at:

1. Your ability to transform your ideas/pseudocode/algorithm to real implementation


2. Your code needs to be 95% syntax correct. This means bracket/indentation/semicolon/colon, etc.
needs to be 95% correct.
3. You don’t need to know all of the API. If there’s a function that you know exists, but you don’t
remember the API correctly, feel free to make an assumption with the interviewer and move on. For
example, if you don’t remember the API to grab the ASCII code of a character or getting the
substring, call it foo(…), put a note what it does and move on.
4. Code completeness mean you should have at least code that has no build/compile error.
5. How you would jump to testing your code right after writing your code to verify correctness. Please
do not wait your interviewer to tell you to test your code. Testing your own code is an important
aspect of an engineer
6. Code cleanliness. Reading somebody else’s code is never fun. It’s your job to make sure that your
code is self-explanatory and well documented/commented (you can use your pseudocode as your
comment). Code cleanliness sometimes means you’ll need to break down your code to multiple
smaller functions where each function does exactly 1 job.
7. If there’s multiple way to implement a step, you can mention that to your interviewer and explain
why you pick this approach over others (code cleanliness, better maintainability, reduce call stack,
etc.), this will give you a bonus point.
8. Timing is especially important so please make sure you know before hand how many coding
questions are asked in each technical round. With that in mind, you can break down how many
minutes should you spend on clarifying, discussing algorithm and writing code/testing. Personally,
for a 45-minute session, I would keep reading/clarifying between 5-10 minutes, and 20-25 minutes
for coding, 5 minutes for testing and leave some time for QnA with the interviewer.
Technical/coding preparation
Please do try to get Leetcode premium if that’s possible. Leetcode premium unblock a bunch of
company-specific questions as well as let you know the frequency of a question being asked in an
interview.

How long preparation takes heavily depends on how much time you can commit. For people who’s
working full time, they usually set a target goal of 6 months, with extra 1-2 hours every day after
working hour for practicing. Overall, building up regular routine of doing leetcode is particularly
important as it put your brain into the ready mode all the time, so you won’t be scared/surprised when
you see a tough question.

There’re multiple ways to get yourself up to speed. Here’s what I did:

1. Spend first week or two working on easy questions. This step mostly is to help you warm up
your DSA. Working on easy question at first will also boost your ego a little bit, as you won’t
struggle much. Jumping straight to medium/hard questions will most likely make you feel
discouraged, as you will have an impression that you’re not good enough
2. After warming up and get a habit of using multiple data structure like hashmap, queue,
stack, hashset, it’s time to get to medium question to elevate your skills
• You can start working on topic by topic, for example BFS/DFS then BST, DP. I highly
recommend that you don’t stay away from any topic for longer than 6-8 weeks since
there’s a possibility that you might forget what you did
• Another option is to work on problems by company tags. Start

You might also like