Codementor Events

Eight must-know concepts for technical interviews

Published May 18, 2020
Eight must-know concepts for technical interviews

Binary search algorithm

The binary search problem is ubiquitous in technical interviews. Amazon and Facebook interviews usually have one question based on binary search or some variant of it like sorted rotate array. It is best to master this topic as there is plenty of room to make mistakes like array out of bound errors, infinite loops, offset by one error.
Binary search tips and problems asked in interviews

Sorting algorithms

It is impossible to come out of an interview and not talk about sorting algorithms. Sometimes, they are asked explicitly, whereas the other times, they are implicitly embedded in our solution. It is very important to understand each sorting algorithm and their time and space complexity.
Sorting algorithms: Implementation, time and space complexities

Dynamic programming

Another concept which is almost always asked in Facebook, Amazon, Google interviews is dynamic programming. On certain instances, classic DP problems are given, on other instances, we have to figure out that the given problem is a DP problem. Understand (not rote) how to solve a DP problem by understanding optimal and overlapping subproblems, recursion trees, top-down and bottom-up approach.
Dynamic programming and problems

Monotonic queue or stack

One of the simplest concept yet can solve many hard problems like rectangle in histogram, trap water problem. Once you master this, you can crack any bar raiser round of FAANG companies.
Monotonic queues and keeping things in order

Graph and depth-first traversal

In FAANG companies interviews, problems based on graph traversals are commonly asked. However, be careful that they do not ask some obscure algorithm on graphs, but problems are based on simple graph traversals like DFS(mostly), BFS(sometimes) and topological sorting(sometimes). One of the popular pattern is using matrix as graph. It is best to prepare these three traversals of graph before going for interview.
Graph and depth-first traversal

Priority queues

Any ranking problem like find top k elements, K most frequent words, or find kth smallest element, requires you to know priority queues and its interal workings. Beauty of problems based on priority queues is that they are easily identifiable and can be solved within 10 mins.
Priority queues and problems

Sliding window

Many problems which involve finding substring or subarray with specific property can be solved using sliding window approach. It is very important to understand how to work with variable size sliding windows and how to maintain property of the window. You will definitely find a problem based on sliding window in Facebook interview.
Sliding window, pattern and problems

Backtracking algorithm

Problem based on backtracking are purely recursive in nature, we have to undertand the pattern that backtracking solutions follow. Once we understand, what is our goal and choices at each point, it is very simple to implement backtracing algorithm.
Backtracking problems

Do you think there is something else one should prepare for technical interviews, please let me know in comments.

Discover and read more posts from Sangar Jitendra Kumar Jakhu
get started
post commentsBe the first to share your opinion
Show more replies