0 votes
in Data Structures & Algorithms by
Data Structures and Algorithms interview questions & MCQ with Solutions

1. __________ is used in dividing the larger problems to subproblems.

Correct Answer of above question is : Modularity

2. The data structure which contains the hierarchical relationship between various elements is called a ________.

Correct Answer of above question is : Tree

3. Insertion and deletion of element in queue are done in _______ and ______ ends respectively.

Correct Answer of above question is : Rear and Front

4. _____ is called a list of the finite number of elements of similar data types.

Correct Answer of above question is : Array

5. __________ is used in finding the location of the record with the given key value.

Correct Answer of above question is : Searching

6. The ______ of the algorithm is depending on the time and space it uses.

Correct Answer of above question is : Efficiency

7. _______ is used in combining the records in two different files into a single file.

Correct Answer of above question is : Merging

8. ________ is a linear collection of nodes.

Correct Answer of above question is : Linked list

9. ________ and ________ are the two fields of linked list.

Correct Answer of above question is : Data and Link fields

10. Processing each node of the linked list exactly once is called as __________.

Correct Answer of above question is : Traversing

11. Stack allows insertion and deletion at one end called ____________.

Correct Answer of above question is : Top

12. Insertion and deletion of element from the stack is performed with ______ and ________ operation.

Correct Answer of above question is : Push and pop

13. Before every insertion into the stack _________ condition need to be checked.

Correct Answer of above question is : OVERFLOW

14. P+Q and (X+Y)* Z is the _____________ expression.

Correct Answer of above question is : Infix

15. Addition is having higher precedence then Multiplication state. True/False.

Correct Answer of above question is : False

16. Specify the method for deleting and element from the queue ________.

Correct Answer of above question is : Dequeue

17. __________ and ___________ are the two pointers are used in queue.

Correct Answer of above question is : FRONT and REAR

18. New node can be availed from __________ list while inserting a new element into the queue.

Correct Answer of above question is : AVAIL

19. ___________ is used to find the location of an item in a linked list.

Correct Answer of above question is : Searching

20. ______________ is used to store the unused memory cells.

Correct Answer of above question is : Free- storage list

Data structures and Algorithms Interview Questions and answers PDF

21. Tree is a non-linear data structure state. True/False

Correct Answer of above question is : True

22. List of nodes belongs to same parent is called ____________.

Correct Answer of above question is : Siblings

23. Tree with only left subtree is called _______________.

Correct Answer of above question is : Left skewed tree

24. ____________ order traversal follow pattern as root, left, right.

Correct Answer of above question is : Preorder

25. In an array representation of binary tree the right child of the root will be at the location at ____________.

Correct Answer of above question is : 3

26. In a complete binary tree right child of a node can be identified by _________.

Correct Answer of above question is : 2*i+1

27. Breadth-first traversal otherwise called as ___________.

Correct Answer of above question is : Level order traversal

28. Linked representation of tree facilitates the efficiency of memory. True/False.

Correct Answer of above question is : True.

29. Conversion of tree to binary tree makes the tree _____________.

Correct Answer of above question is : Improper

30. Incomplete tree is very efficient in memory management. (True/False)

Correct Answer of above question is : False

31. _______ is used to denote the leaf node representation as 1 in preorder sequential representation.

Correct Answer of above question is : TAG

32. __________ and __________ are the vectors used for postorder sequential representation.

Correct Answer of above question is : POST and DEGREE

33. A graph containing only isolated vertices is called __________. (Pick the right option)

a) isolated graph

b) null graph

c) directed graph

d) multigraph

Correct Answer of above question is : b) – null graph

34. In a directed graph, the ________ of a vertex v is the number edges of leaving v, and its _______ is the number of edges ending at v. (Pick the right option)

a) in-degree, out-degree b) out-degree, in-degree

c) degree, edges d) edges, degree

Correct Answer of above question is : b) Out-degree, In-degree

Data structure interview questions for experienced

35. In the adjacency matrix, ‘1’ is marked in a cell if there exists an edge between two nodes that index that cell. (True/false)

Correct Answer of above question is : True

36. A null graph consists of V vertices but no edges, then the adjacency matrix has all of its entire elements as____.

Correct Answer of above question is : zero)

37. In incidence matrix, If the kth edge is (vi, vj ) then the kth column has a value _____ in the ith row, ______ in the jth row and ______ elsewhere.

a) 1,-1,0

b) -1,1,0

c) 0,1,-1

d) 0,-1,1

Correct Answer of above question is : a) 1,-1,0

38. For adjacency list the number of distinct unordered pairs (vi, vj) with vi,≠ vj in a graph with n vertices is____.

Correct Answer of above question is : n (n-1)/2

39. Pick the right option

The three properties associated with list structures are:

a) Order, depth, length

b) Degree, vertices, edges

c) Atom, element, list

d) Cost, weight, data

Correct Answer of above question is : a) order, depth, length

40. In-Depth First search the same node is visited more than once. (True/False)

Correct Answer of above question is : False

41. Breadth-first search algorithm uses a __________ data structure to perform the search. (Pick the right option)

a) Tree

b) Linked-list

c) Queue

d) Hashes

Correct Answer of above question is : c) Queue

42. A spanning tree is known as spanning forest if the graph is undirected and connected. (True/False)

Correct Answer of above question is : False

43. If the graph is not connected in the spanning tree, then it is known as _____________.

Correct Answer of above question is : spanning forest

44. ____________ technique is used to collect all the free cells and store that in free pool.

Correct Answer of above question is : Garbage Collection

45. ______________ and ______________ are the types of linked list.

Correct Answer of above question is : Doubly and Circular linked list

46. Doubly linked list are also called as ______________.

Correct Answer of above question is : Two- way list

47. Nodes do not have any clear parent-child relationship like in the tree. (True/False)

Correct Answer of above question is : True

48. In an undirected graph, edge (v1,v2) is equivalent to edge ________ since they are unassigned.

Correct Answer of above question is : (v2,v1)

49. A directed graph is also referred to as an ––––––––––.

Correct Answer of above question is : Oriented Graph

50. The number of edges incident out of a vertex v is called the–––––––––.

Correct Answer of above question is : Out-Degree

Data Structures Interview Questions MCQ

51. DAGs may have more than one possible topological order. (True/False)

Correct Answer of above question is : True

52. Descriptor’s successor must appear after that descriptor in ______ ordering for topological sort.

a) linear

b) alphabetical

c) random

d) unique

Correct Answer of above question is : a) linear

53. Dijkstra’s algorithm can be applied for unweighted directed graph. (True/False)

Correct Answer of above question is : False

54. In Dijkstra’s algorithm, _______ are assigned to each vertex.

a) weight

b) length

c) cost

d) labels

Correct Answer of above question is : d) labels

55. Minimum spanning tree is always unique. (True/False)

Correct Answer of above question is : False

56. Minimum spanning tree is a graph with weight ________ than or _______ to the weight of every other spanning tree. (Pick the right option)

a) less, greater

b) less, equal

c) greater, equal

d) greater, always greater.

Correct Answer of above question is : b) less, equal

57. Prim’s minimum spanning tree algorithm is known as ____________ style algorithm.

a) greedy

b) unique

c) linear

d) sparse

Correct Answer of above question is : a) greedy

58. There are certain polynomial-time algorithms which can be considered tractable. (True/False)

Correct Answer of above question is : True

59. If the solution is found out to minimize or maximize a given value, then such type of problems are ____________ problems.

Correct Answer of above question is : optimization

60. An algorithm that returns near-optimal solutions (in polynomial time) is called ___________algorithm.

Correct Answer of above question is : Approximation

Data structures Programming interview questions

61. A problem is NP-hard if an algorithm to solve it in (deterministic) polynomial time would make it possible to solve all _________ problems in polynomial time. (Pick the right option)

a) decision

b) non-deterministic

c) NP

d) optimization

Correct Answer of above question is : c) NP

62. Identify the algorithm given below:

For k = 0 to n-1

MIN⇓ k

For m = k + 1 to n

if (A[m] < A[k]

MIN⇓ m

End if

Swap(A[m], A[k]); // swap min to front

Return

Correct Answer of above question is : selection sort

63. A vertex v is said to be an isolated vertex if the out-degree of v and the in-degree of v are equal to ––––––––.

Correct Answer of above question is : Zero

64. Let X be a set, and R a relation on X. The relation R is said to be ––––– if a, b, c ∈ R, aRb, bRc ⇒ aRc.

Correct Answer of above question is : Transitive

65. Each maximal connected subgraph of a digraph D, is said to be a ––––– of D

Correct Answer of above question is : Component

66. A closed directed walk which traverses every edge of D exactly once, is called a –––––––––.

Correct Answer of above question is : Directed Euler line

67. A tree of n vertices contains –––––––– edges.

Correct Answer of above question is : n – 1

68. Let D be a digraph with p vertices. The adjacency matrix of D is a –––– matrix

Correct Answer of above question is : pxp

69. Sorting is the process of arranging the content in some order based on _________ criterion.

Correct Answer of above question is : ordering

70. Merge sort uses ______________ technique to sort the elements.

Correct Answer of above question is : divide-and-conquer

Related questions

0 votes
asked Aug 9, 2023 in DBMS by DavidAnderson
0 votes
asked Aug 9, 2023 in DBMS by DavidAnderson
...