C

Top 30 Algorithms You Must Know for Coding Interview

Since algorithms are just part of the solutions to bigger problems, an in-depth understanding of computer science data structures and algorithms is necessary. If you are preparing for a coding interview, then understanding the algorithms and their implementation is essential. The following list provides the Top 30 Algorithms You Must Know for Coding Interview.

Top 30 Algorithms You Must Know for Coding Interview

1. Find Maximum

Since finding maximum from a number of values is required in solving many problems. Therefore, one of the simplest problems is to find the maximum from the one-dimensional array.  Also, compute the complexity of the algorithm. View Solution.

2. Linear Search

Another important algorithm that most applications require is searching. Implement Linear Search with a single occurrence of target value as well as with multiple occurrences. View Solution.

3. Binary Search

Because the efficiency of algorithms is important for their implementation, compare both linear search and binary search for their respective time complexity. Also, implement the Binary Search algorithm. View Solution.

4. Selection Sort

Implement Selection sort algorithm. View Solution.

5. Bubble Sort

Write a program to implement Bubble sort algorithm. View Solution.

6. Insertion Sort

Find the time complexity of Insertion sort and also implement it. Further, compare the time complexity of all sorting algorithms. View Solution.

7. Merge Sort

As a matter of fact, the divide-and-conquer strategy reduces the running time of algorithms substantially. Write a program for Merge sort and show its time complexity. View Solution.

8. Quick Sort

Write a program for Quick sort algorithm.

9. Heap Sort

Implement Heap Sort algorithm.

10. Bucket Sort

Write a program to implement Bucket Sort.

11. Radix Sort

Implement Radix Sort algorithm.

12. Minimum and Maximum

Write a program to find out Minimum and Maximum using the minimum number of comparison operators.

13. Randomized Select

Implement a program to find out ith order statistic (Randomized Select)

14. Breadth First Search (BFS)

Since traversing a search tree has many applications including the optimal route finding, its efficient implementation is also important. Write a program to implement Breadth First Search (BFS) algorithm.

15. Depth First Search (DFS)

Another important traversal algorithm is Depth First Search (DFS) that we can use to determine cycles in a graph. Write a program to implement the DFS algorithm.

16. Matrix Chain Multiplication (MCM)

Basically, Matrix Chain Multiplication (MCM) is an optimization problem. In general, this problem requires us to find the most efficient way in which we can multiply two or more matrices. Therefore, here we need to find the most optimal order of matrix multiplication. Implement matrix chain multiplication algorithm in a programming language.

17. Longest Common Subsequence (LCS)

Another important algorithm is the Longest Common Subsequence (LCS) that has applications in bioinformatics. Implement the Longest Common subsequence algorithm. 

18. Warshall’s Algorithm

In case we want to compute the transitive closure of a given directed graph, we can use Warshall’s algorithm. Write a program to implement Warshall’s algorithm.

19. 0/1 Knapsack Problem

Since 0-1 Knapsack problem is one of the most widely used combinatorial optimization problem. Therefore, write a program to implement 0/1 Knapsack problem using Dynamic Programming.

20. Kruskal’s Algorithm

As can be seen, the Minimum Cost Spanning Trees have lots of applications, so their implementation is important to learn. Hence, implement a program in C language to find MST of a given undirected graph using Kruskal’s algorithm.

21. Prim’s Algorithm

As can be seen, the Minimum Cost Spanning Tree has several applications related to finding the optimal route, For instance, we can apply a Minimum Cost Spanning Tree algorithm in network problems, laying out towers, roads, channels, and so on. Therefore, implement code in C language to find MST of a given undirected graph using Prim’s algorithm.

22. Dijkstra Algorithm

Another important algorithm that we use in routing protocols is the Dijkstra algorithm. Write a program to implement the Dijkstra algorithm.

23. Bellman-Ford Algorithm

Indeed another algorithm that finds the shortest path is the Bellman-Ford algorithm. Write a program to implement the Bellman-Ford algorithm.

24. Naive String Matching Algorithm

Particularly, this algorithm is useful in pattern matching. Hence, it finds its place in many applications. Write a program to implement the Naïve string matching algorithm.

25. Rabin-Karp Algorithm

However, another efficient algorithm for pattern matching is the Rabin-Karp algorithm. Write a program to implement the Rabin –Karp algorithm.

26. Knuth Morris Pratt (KMP Algorithm

Another algorithm for pattern matching is the KMP algorithm. Write a program to implement the KMP string matching algorithm.

27. Huffman Coding Algorithm

Since data compression is necessary for many applications, compression algorithms are very important. In fact, the Huffman Coding algorithm is one of the compression algorithms. Write a program to implement the Huffman coding algorithm.

28. Hashing Table Using Open Addressing

In fact, the open addressing hashing algorithm can handle the collisions. Therefor, it is implemented in many applications. Write a program to implement Hashing table using open addressing system.

29. Perfect Hashing and Universal Hashing

Moreover, there are better efficient algorithms to implement the hashing. Specifically, these methods are perfect hashing and Universal Hashing. Write a program to implement Hashing table using Perfect Hashing and Universal hashing.

30. N Queens Problem

Another problem that we can solve using backtracking is the N Queens problem. Write a program to solve the N Queens problem.


Related Topics

Getting Started with C Programming

Solve Simple Programming Problems

Leave a Reply

Your email address will not be published. Required fields are marked *