These are some must-know algorithms to crack FAANG interviews!

Programming Pathshala
3 min readApr 26, 2022

I often get this question asked by our students at Programming Pathshala, as everyone wants to crack FAANG companies and what better than to know some tricks for getting into one?

Hi, my name is Bharat Khanna and I am one of the Co-Founder here at Programming Pathshala. Going by our past experience of training thousands of students at Programming Pathshala and helping them get successfully placed in a few FAANG companies, here are some must know Algorithms to crack FAANG interviews-

  1. Precomputation Techniques: Many people do not consider them as important but they are extremely crucial. Many problems have prefix/suffix computations as an important step of optimisation.
  2. Binary Search Algorithm: Binary search is not as simple as finding an element in a sorted array. It has much more complicated use cases which is important to know and work on. Concepts of monotonic functions and binary search on answer help you appreciate the beauty of this simple algorithm and make you a good problem solver.
  3. Sorting Algorithms: Knowing different sorting algorithms like Bubble, Insertion, Selection, Merge, Quick and many more O(n) sorts is important. Also, these algorithms have associated techniques like Divide and Conquer in Merge and Quick Sort, Dutch National Flag problem, etc which are also important.
  4. Two Pointers & Sliding Window: Two Pointer Approach is optimised Binary Search Approach in 90% of the cases. Optimising binary search solutions by using 2 Pointers is an important step asked in many interviews.
  5. Greedy Algorithms: This is the most difficult algorithm to spot in a problem. Getting to know that a problem can be solved by a particular greed and proving it is very difficult. Proof by induction, contradiction and mathematical proofs come handy for these problems.
  6. Recursion, Backtracking and Dynamic Programming: I have clubbed them together because you can’t do Dynamic Programming without fully understanding Recursion & Backtracking. Understand concepts of Recurrence Relation, Stack and Tree Diagrams, Concept of Memoization, state, etc. Many people start solving DP without understanding the theory. This is one topic where if you are clear with the theory, you will not be stuck in many problems.
  7. Graph Search Algorithms: No fancy Djikstra or Flow Algorithms. No fancy Segment Trees. The most important is mastering the two search algorithms — Depth First Search and Breadth First Search in detail.

There are other less important algorithms like Bit Manipulation, Mathematical Algorithms and other subjects that you also need to cover for these interviews (Data Structures, OOPs, OS, DBMS, etc.) For a complete syllabus, you can go through our website.

Most important thing to note is “Focus more on covering every aspect of an algorithm you are learning and understand the patterns associated with it. Do not unnecessarily go for heavy algorithms like segment tree. Stick to the basics and you should be good”

Hope you find it useful and may it help you prepare better for your FAANG interview preparation.

For more such information, you can also login to www.programmingpathshala.com and take a free trial today.

Have a doubt or a suggestion? Reach out to us at info@programmingpathshala.com

--

--

Programming Pathshala

We are working to democratise access to Tech Education. We help students learn coding and be confident about themselves.