InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following can traverse the state space tree only in DFS manner?(a) branch and bound(b) dynamic programming(c) greedy algorithm(d) backtrackingI got this question during a job interview.I would like to ask this question from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» Correct CHOICE is (d) backtracking |
|
| 2. |
Choose the correct statement from the following.(a) branch and bound is more efficient than backtracking(b) branch and bound is not suitable where a greedy algorithm is not applicable(c) branch and bound divides a problem into at least 2 new restricted sub problems(d) backtracking divides a problem into at least 2 new restricted sub problemsI have been asked this question in final exam.My doubt stems from Graph Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Correct answer is (c) BRANCH and bound divides a problem into at least 2 new restricted sub problems |
|
| 3. |
Both LIFO branch and bound strategy and backtracking leads to depth first search.(a) true(b) falseThis question was addressed to me in my homework.I would like to ask this question from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The correct option is (a) true |
|
| 4. |
Both FIFO branch and bound strategy and backtracking leads to depth first search.(a) true(b) falseThe question was asked in an interview.The above asked question is from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The CORRECT option is (b) false |
|
| 5. |
Which of the following branch and bound strategy leads to depth first search?(a) LIFO branch and bound(b) FIFO branch and bound(c) Lowest cost branch and bound(d) Highest cost branch and boundI got this question in an online interview.Question is taken from Graph Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Correct answer is (a) LIFO branch and BOUND |
|
| 6. |
Which of the following branch and bound strategy leads to breadth first search?(a) LIFO branch and bound(b) FIFO branch and bound(c) Lowest cost branch and bound(d) Highest cost branch and boundThis question was addressed to me in an interview for job.My question comes from Graph Search topic in portion Graph Search of Data Structures & Algorithms II |
|
Answer» CORRECT option is (b) FIFO branch and bound Explanation: LIFO, FIFO and Lowest COST branch and bound are DIFFERENT strategies to generate branches.FIFO branch and bound leads to breadth first search. |
|
| 7. |
Which data structure is most suitable for implementing best first branch and bound strategy?(a) stack(b) queue(c) priority queue(d) linked listThis question was posed to me in my homework.Question is from Graph Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Right answer is (c) PRIORITY queue |
|
| 8. |
Which data structure is used for implementing a FIFO branch and bound strategy?(a) stack(b) queue(c) array(d) linked listI got this question in an online quiz.This intriguing question comes from Graph Search topic in section Graph Search of Data Structures & Algorithms II |
|
Answer» CORRECT OPTION is (b) queue For explanation: Queue is the data structure is used for implementing FIFO branch and bound strategy. This leads to breadth first search as every branch at DEPTH is explored first before moving to the nodes at greater depth. |
|
| 9. |
Which data structure is used for implementing a LIFO branch and bound strategy?(a) stack(b) queue(c) array(d) linked listThe question was asked in examination.I need to ask this question from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» Correct choice is (a) STACK |
|
| 10. |
Which of the following is not a branch and bound strategy to generate branches?(a) LIFO branch and bound(b) FIFO branch and bound(c) Lowest cost branch and bound(d) Highest cost branch and boundI have been asked this question during a job interview.I'd like to ask this question from Graph Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Correct ANSWER is (d) HIGHEST cost BRANCH and bound |
|
| 11. |
Branch and bound is a __________(a) problem solving technique(b) data structure(c) sorting algorithm(d) type of treeI have been asked this question by my school principal while I was bunking the class.My enquiry is from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (a) problem solving TECHNIQUE Easy explanation - Branch and bound is a problem solving technique GENERALLY USED for solving combinatorial OPTIMIZATION problems. Branch and bound helps in solving them faster. |
|
| 12. |
Who published the B* search algorithm?(a) Peter Hart(b) Nils Nilsson(c) Bertram Raphael(d) Hans BerlinerI got this question in unit test.This is a very interesting question from Graph Search in section Graph Search of Data Structures & Algorithms II |
|
Answer» RIGHT option is (d) HANS Berliner Easiest explanation - Hans Berliner was a Computer Science professor who first PUBLISHED the B* search algorithm in 1979. While Peter HART Nils Nilsson Bertram Raphael are the three scientists of SRI International who first published the A* search algorithm which uses heuristics for better PERFORMANCE. |
|
| 13. |
Which of the following scientists didn’t publish A* algorithm?(a) Peter Hart(b) Nils Nilsson(c) Bertram Raphael(d) Hans BerlinerThe question was posed to me at a job interview.Query is from Graph Search topic in division Graph Search of Data Structures & Algorithms II |
|
Answer» Right choice is (d) Hans BERLINER |
|
| 14. |
Which of the following is the greedy best first search?(a) Pure Heuristic Search(b) A*(c) B*(d) Both A* and B*This question was addressed to me in quiz.The doubt is from Graph Search topic in section Graph Search of Data Structures & Algorithms II |
|
Answer» CORRECT choice is (a) Pure HEURISTIC Search Easiest EXPLANATION - Pure Heuristic Search is also called GREEDY best first search while A* and B* search algorithms are not greedy best first search. |
|
| 15. |
Which of the following is an example of Best First Search algorithm?(a) A*(b) B*(c) C*(d) Both A* and B*I got this question by my school teacher while I was bunking the class.Origin of the question is Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (d) Both A* and B* Explanation: In computer SCIENCE, A* algorithm is used in graph TRAVERSAL and path finding. It is a process of node finding in between a path. B* algorithm is used to FIND the LEAST cost path between the source node and the destination node. |
|
| 16. |
Which algorithm is used to find the least cost path from source node to destination node?(a) A* BFS(b) C* BFS(c) D* BFS(d) B* BFSThis question was posed to me in an interview for internship.My enquiry is from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» Right choice is (d) B* BFS |
|
| 17. |
Which algorithm is used in graph traversal and path finding?(a) A*(b) C*(c) D*(d) E*This question was posed to me during an online exam.My doubt is from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» Right option is (a) A* |
|
| 18. |
What is the other name of the greedy best first search?(a) Heuristic Search(b) Pure Heuristic Search(c) Combinatorial Search(d) Divide and Conquer SearchThe question was posed to me during an interview.I want to ask this question from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The CORRECT choice is (b) Pure Heuristic Search |
|
| 19. |
Which type of best first search algorithm was used to predict the closeness of the end of path and its solution?(a) Greedy BFS(b) Divide and Conquer(c) Heuristic BFS(d) CombinatorialThe question was posed to me in an interview.My question is based upon Graph Search topic in portion Graph Search of Data Structures & Algorithms II |
|
Answer» Correct choice is (a) Greedy BFS |
|
| 20. |
Who described this Best First Search algorithm using heuristic evaluation rule?(a) Judea Pearl(b) Max Bezzel(c) Franz Nauck(d) Alan TuringI have been asked this question during a job interview.My doubt stems from Graph Search topic in portion Graph Search of Data Structures & Algorithms II |
|
Answer» Correct choice is (a) Judea Pearl |
|
| 21. |
Is Best First Search a searching algorithm used in graphs.(a) True(b) FalseThis question was posed to me by my college professor while I was bunking the class.My doubt is from Graph Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» Right choice is (a) True |
|
| 22. |
In BFS, how many times a node is visited?(a) Once(b) Twice(c) Equivalent to number of indegree of the node(d) ThriceThis question was posed to me during an interview.This key question is from Breadth First Search topic in section Graph Search of Data Structures & Algorithms II |
|
Answer» The correct answer is (c) Equivalent to number of INDEGREE of the node |
|
| 23. |
Regarding implementation of Breadth First Search using queues, what is the maximum distance between two nodes present in the queue? (considering each edge length 1)(a) Can be anything(b) 0(c) At most 1(d) Insufficient InformationThis question was addressed to me in class test.This intriguing question comes from Breadth First Search topic in division Graph Search of Data Structures & Algorithms II |
|
Answer» Right option is (c) At most 1 |
|
| 24. |
When the Breadth First Search of a graph is unique?(a) When the graph is a Binary Tree(b) When the graph is a Linked List(c) When the graph is a n-ary Tree(d) When the graph is a Ternary TreeThe question was asked by my school principal while I was bunking the class.My question is taken from Breadth First Search topic in portion Graph Search of Data Structures & Algorithms II |
|
Answer» The correct answer is (b) When the graph is a LINKED List |
|
| 25. |
Which of the following is not an application of Breadth First Search?(a) Finding shortest path between two nodes(b) Finding bipartiteness of a graph(c) GPS navigation system(d) Path FindingI got this question in a national level competition.Question is taken from Breadth First Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» Right choice is (d) Path Finding |
|
| 26. |
A person wants to visit some places. He starts from a vertex and then wants to visit every place connected to this vertex and so on. What algorithm he should use?(a) Depth First Search(b) Breadth First Search(c) Trim’s algorithm(d) Kruskal’s algorithmThe question was posed to me in an international level competition.My doubt stems from Breadth First Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Right answer is (b) Breadth FIRST SEARCH |
|
| 27. |
The Breadth First Search traversal of a graph will result into?(a) Linked List(b) Tree(c) Graph with back edges(d) ArraysThe question was posed to me by my school teacher while I was bunking the class.My question is taken from Breadth First Search in section Graph Search of Data Structures & Algorithms II |
|
Answer» Correct CHOICE is (b) TREE |
|
| 28. |
The Data structure used in standard implementation of Breadth First Search is?(a) Stack(b) Queue(c) Linked List(d) TreeI have been asked this question during an internship interview.Query is from Breadth First Search in portion Graph Search of Data Structures & Algorithms II |
|
Answer» The correct answer is (b) QUEUE |
|
| 29. |
Time Complexity of Breadth First Search is? (V – number of vertices, E – number of edges)(a) O(V + E)(b) O(V)(c) O(E)(d) O(V*E)I got this question during an interview.My question is from Breadth First Search topic in division Graph Search of Data Structures & Algorithms II |
|
Answer» Correct answer is (a) O(V + E) |
|
| 30. |
Breadth First Search is equivalent to which of the traversal in the Binary Trees?(a) Pre-order Traversal(b) Post-order Traversal(c) Level-order Traversal(d) In-order TraversalI have been asked this question during a job interview.Question is from Breadth First Search topic in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The correct CHOICE is (c) Level-order Traversal |
|
| 31. |
Choose the incorrect statement about DFS and BFS from the following?(a) BFS is equivalent to level order traversal in trees(b) DFS is equivalent to post order traversal in trees(c) DFS and BFS code has the same time complexity(d) BFS is implemented using queueThis question was posed to me in final exam.Query is from Non-recursive Depth First Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The correct ANSWER is (b) DFS is equivalent to post order traversal in trees |
|
| 32. |
In Depth First Search, how many times a node is visited?(a) Once(b) Twice(c) Equivalent to number of indegree of the node(d) ThriceThis question was addressed to me during an interview for a job.My doubt is from Depth First Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Correct option is (c) Equivalent to number of INDEGREE of the node |
|
| 33. |
Regarding implementation of Depth First Search using stacks, what is the maximum distance between two nodes present in the stack? (considering each edge length 1)(a) Can be anything(b) 0(c) At most 1(d) Insufficient InformationThe question was posed to me during an interview for a job.Question is taken from Depth First Search topic in division Graph Search of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (a) Can be anything |
|
| 34. |
When the Depth First Search of a graph is unique?(a) When the graph is a Binary Tree(b) When the graph is a Linked List(c) When the graph is a n-ary Tree(d) When the graph is a ternary TreeThis question was addressed to me in a national level competition.The above asked question is from Depth First Search in portion Graph Search of Data Structures & Algorithms II |
|
Answer» Correct choice is (b) When the graph is a Linked List |
|
| 35. |
Which of the following is not an application of Depth First Search?(a) For generating topological sort of a graph(b) For generating Strongly Connected Components of a directed graph(c) Detecting cycles in the graph(d) Peer to Peer NetworksThis question was posed to me by my college director while I was bunking the class.This intriguing question originated from Depth First Search in section Graph Search of Data Structures & Algorithms II |
|
Answer» Right CHOICE is (d) Peer to Peer Networks |
|
| 36. |
A person wants to visit some places. He starts from a vertex and then wants to visit every vertex till it finishes from one vertex, backtracks and then explore other vertex from same vertex. What algorithm he should use?(a) Depth First Search(b) Breadth First Search(c) Trim’s algorithm(d) Kruskal’s AlgorithmThis question was addressed to me during an online exam.My doubt stems from Depth First Search in division Graph Search of Data Structures & Algorithms II |
|
Answer» Right answer is (a) Depth First Search |
|
| 37. |
The Depth First Search traversal of a graph will result into?(a) Linked List(b) Tree(c) Graph with back edges(d) ArrayI have been asked this question in final exam.I want to ask this question from Depth First Search in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» RIGHT CHOICE is (b) Tree Explanation: The DEPTH First Search will make a GRAPH which don’t have back EDGES (a tree) which is known as Depth First Tree. |
|
| 38. |
Time Complexity of DFS is? (V – number of vertices, E – number of edges)(a) O(V + E)(b) O(V)(c) O(E)(d) O(V*E)The question was asked in an interview for job.This question is from Depth First Search topic in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The correct choice is (a) O(V + E) |
|
| 39. |
The Data structure used in standard implementation of Breadth First Search is?(a) Stack(b) Queue(c) Linked List(d) TreeThe question was posed to me in semester exam.Question is from Depth First Search topic in chapter Graph Search of Data Structures & Algorithms II |
|
Answer» The correct option is (a) Stack |
|
| 40. |
Depth First Search is equivalent to which of the traversal in the Binary Trees?(a) Pre-order Traversal(b) Post-order Traversal(c) Level-order Traversal(d) In-order TraversalI got this question in final exam.This is a very interesting question from Depth First Search in section Graph Search of Data Structures & Algorithms II |
|
Answer» CORRECT choice is (a) Pre-order Traversal Easy explanation - In Depth First SEARCH, we EXPLORE all the nodes aggressively to ONE path and then BACKTRACK to the node. Hence, it is equivalent to the pre-order traversal of a Binary Tree. |
|