These are some must-know algorithms to crack FAANG interviews!
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-
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 firstname.lastname@example.org