Top Algorithms Interview Questions
Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement handbooks also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.
Question
17
Explanation
Define - Dijkstra‘s Algorithm
Dijkstra‘s algorithm solves the single source shortest path problem of finding shortest paths from a given vertex[ the source], to all the other vertices of a weighted graph or digraph. Dijkstra‘s algorithm provides a correct solution for a graph with non-negative weights.
Please refer adjacent cell for example:
The shortest paths [identified by following nonnumeric labels backward from a destination vertex in the left column to the source] and their lengths [given by numeric labels of the tree vertices] are as follows:
> from a to b : a − b of length 3
> from a to d : a − b − d of length 5
> from a to c : a − b − c of length 7
> from a to e : a − b − d − e of length 9
Question
18
Explanation
Give examples of Brute force techniques?
- Exhaustive searching techniques [TSP,KP,AP]
- Finding closest pair and convex hull problems
- Sorting: selection and bubble sort
- Searching: Brute force string match and sequential search.
- Computing n!
Question
19
Explanation
Give examples of divide and conquer.
-Sorting : Merge sort and quick sort
- Search: Binary search
- Strassen‘s Matrix multiplication
- Finding closest pair and convex hull problems
- Multiplication of large integers
Question
20
Explanation
Write procedure of DFS.
a. Select an unvisited node x, visit it, and treat as the current node
b. Find an unvisited neighbor of the current node, visit it, and make it the new current node;
c. If the current node has no unvisited neighbors, backtrack to the its parent, and make that parent the new current node;
d. Repeat steps 3 and 4 until no more nodes can be visited.
e. If there are still unvisited nodes, repeat from step 1.



.png)