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.
| 51. |
Brick sort uses which of the following methods for sorting the input?(a) selection(b) partitioning(c) merging(d) exchangingI had been asked this question during an interview.My question is taken from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right CHOICE is (d) exchanging |
|
| 52. |
Odd-even sort is a comparison based sort.(a) true(b) falseThe question was posed to me by my college professor while I was bunking the class.The above asked question is from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT choice is (a) true |
|
| 53. |
Which of the following sorting algorithm is in place?(a) brick sort(b) merge sort(c) counting sort(d) radix sortThis question was posed to me during an interview.The query is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (a) BRICK SORT |
|
| 54. |
Which of the following sorting algorithm is NOT stable?(a) Quick sort(b) Brick sort(c) Bubble sort(d) Merge sortThis question was posed to me in homework.Question is taken from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT OPTION is (a) Quick sort Easiest explanation - Out of the given OPTIONS quick sort is the only algorithm which is not STABLE. BRICK sort like bubble sort is a stable sorting algorithm. |
|
| 55. |
Auxiliary space requirement of odd-even sort is ___________(a) O(n)(b) O(log n)(c) O(1)(d) O(n^2)I have been asked this question in my homework.My question is taken from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (c) O(1) |
|
| 56. |
Odd-even sort is a variation of ___________(a) Bubble sort(b) Selection sort(c) Insertion sort(d) Gnome sortI got this question in an internship interview.The above asked question is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT choice is (a) Bubble sort |
|
| 57. |
Odd-even sort is also known as ____________(a) stupid sort(b) smart sort(c) brick sort(d) bogo sortThis question was addressed to me in an internship interview.This intriguing question originated from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (C) brick SORT |
|
| 58. |
The Pancake Problems (1975, 1979, 1973) did NOT involve which of the following people?(a) Bill Gates(b) Jacob Goodman(c) Christos Papadimitriou(d) John GoodmanI got this question by my school principal while I was bunking the class.My query is from Pancake Sort in division Sorting of Data Structures & Algorithms II |
|
Answer» Correct option is (d) John GOODMAN |
|
| 59. |
When we realize a specific implementation of a pancake algorithm, every move when we find the greatest of the sized array and flipping can be modeled through __________(a) Combinations(b) Exponential functions(c) Logarithmic functions(d) PermutationsI have been asked this question in an internship interview.This key question is from Pancake Sort topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (d) PERMUTATIONS |
|
| 60. |
In a computational complexity theory, a problem with decision making is said to be NP-complete when it is both in NP and NP-hard. What does NP mean?(a) Non Polynomial time(b) Non-deterministic Probabilistic(c) Non-deterministic Polynomial time(d) Non Probabilistic timeI have been asked this question in examination.Query is from Pancake Sort in chapter Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT choice is (C) Non-deterministic POLYNOMIAL time The best explanation: Although any given solution to an NP-complete problem can be validated quickly in polynomial time; there is no way to efficiently LOCATE a solution to begin with. The UNIQUE characteristic of NP-complete problems is that no fast solution to them is known and hence NP-complete problems are said to be non-deterministic polynomial time. |
|
| 61. |
In addition to the pancake sorting problem, there is the case of the burnt pancake problem in which we are dealing with pancakes (discs) that are burnt on one side only. In this case it is taken that the burnt side must always end up _______(a) Faced down(b) Faced up(c) It doesn’t matter(d) Both sides are burntThis question was posed to me at a job interview.I'm obligated to ask this question of Pancake Sort topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (a) FACED down |
|
| 62. |
Pancake Sorting appears in which of the following?(a) Frequency Scaling(b) Storage Virtualization(c) Parallel Processing(d) Neural NetworkingI got this question in semester exam.This interesting question is from Pancake Sort topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT CHOICE is (c) Parallel Processing Easy EXPLANATION - Pancake Sorting finds APPLICATION in educational use not to mention parallel processing networks by PROVIDING optimal routing algorithms between networks. |
|
| 63. |
How many flips does the simplest of pancake sorting techniques require?(a) 3n−3 flips(b) 2n-4 flips(c) 2n-3 flips(d) 3n-2 flipsI got this question in class test.My question is based upon Pancake Sort topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (c) 2n-3 flips The best I can explain: The minimum number of flips required to sort any stack of n PANCAKES has been shown to lie between 1.087n and 1.636n. using average of that 1.36n and EXTRACTING that for values of n>1. We have 1.36, 2.72, 4.08 etc. This MATCHES best with 2n-3 which is equal to 1, 3, 5, 7, 9, etc. An upper bound of 2n-3 comes by iteratively using the next largest element in its correct place using two flips. |
|
| 64. |
What is the time complexity for a given pancake sort given it undergoes “n” flip operations?(a) O(n)(b) O(n^2)(c) O(n^3)(d) O(2n)This question was addressed to me during an online exam.My question is taken from Pancake Sort in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) O(n^2) |
|
| 65. |
Which operation is most essential to the process of pancake sort?(a) Flip the given data(b) Find the largest of given data(c) Finding the least of given data(d) Inserting something into the given dataI had been asked this question in exam.I'd like to ask this question from Pancake Sort in portion Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT answer is (a) Flip the GIVEN data |
|
| 66. |
How many comparisons will be required to sort the array arr={5, 4, 7, 1, 9} using bead sort?(a) 5(b) 4(c) 6(d) 0This question was posed to me in unit test.My question is based upon Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» Correct answer is (d) 0 |
|
| 67. |
Bead sort is a comparison based sorting algorithm.(a) true(b) falseThis question was posed to me in semester exam.Query is from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) false |
|
| 68. |
Which of the following sorting algorithm is not in place?(a) quick sort(b) bead sort(c) cycle sort(d) heap sortThe question was asked during an online exam.I'd like to ask this question from Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» Correct option is (b) bead sort |
|
| 69. |
What is the auxiliary space complexity of bead sort?(a) O(n)(b) O(1)(c) O(n^2)(d) O(n log n)I got this question in semester exam.My question is based upon Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct CHOICE is (C) O(n^2) |
|
| 70. |
Which of the following sorting algorithm is only applicable to positive integers?(a) quick sort(b) heap sort(c) bead sort(d) strand sortI have been asked this question in an internship interview.Origin of the question is Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (c) bead sort To EXPLAIN: Bead sort algorithm is only applicable to positive INTEGERS. This is because it works by placing NUMBER of beads equal to key VALUE, in each row. |
|
| 71. |
Which of the following sorting algorithm was inspired by the natural phenomenon of falling objects?(a) bogo sort(b) heap sort(c) bead sort(d) strand sortThis question was posed to me during an interview for a job.I would like to ask this question from Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» The correct ANSWER is (c) bead sort |
|
| 72. |
Bead sort is also known as _________(a) gravity sort(b) strand sort(c) abacus sort(d) counting sortThe question was asked in my homework.The query is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT option is (a) gravity sort The best explanation: Bead sort is also known as gravity sort. It is because this algorithm was designed by keeping the NATURAL PHENOMENON of falling objects in MIND. |
|
| 73. |
What is the worst space complexity of bucket sort (k = number of buckets)?(a) O(n + k)(b) O(n.k)(c) O(n^2)(d) O(n log n)This question was addressed to me in an interview for internship.Query is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (b) O(n.k) |
|
| 74. |
Bucket sort is an in place sorting algorithm.(a) True(b) FalseThe question was asked by my college director while I was bunking the class.My question is taken from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right OPTION is (b) False |
|
| 75. |
Which of the following is not necessarily a stable sorting algorithm?(a) bucket sort(b) counting sort(c) merge sort(d) pigeonhole sortI got this question by my college director while I was bunking the class.This intriguing question originated from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (a) BUCKET sort |
|
| 76. |
What is the best time complexity of bucket sort (k= number of buckets)?(a) O(n + k)(b) O(n.k)(c) O(n^2)(d) O(n log n)I had been asked this question during an online exam.This key question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Correct answer is (a) O(n + K) |
|
| 77. |
What is the worst case time complexity of bucket sort (k = number of buckets)?(a) O(n + k)(b) O(n.k)(c) O(n^2)(d) O(n log n)The question was posed to me in a job interview.I'd like to ask this question from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (c) O(n^2) |
|
| 78. |
Bucket sort is a generalization of which of the following sort?(a) LSD radix sort(b) Pigeonhole sort(c) Counting sort(d) MSD radix sortI had been asked this question during an interview for a job.My question is taken from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT ANSWER is (b) Pigeonhole SORT |
|
| 79. |
Bucket sort is most efficient in the case when __________(a) the input is non uniformly distributed(b) the input is uniformly distributed(c) the input is randomly distributed(d) the input range is largeThis question was addressed to me in a national level competition.The question is from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Correct choice is (b) the INPUT is UNIFORMLY distributed |
|
| 80. |
Which of the following don’t affect the time complexity of bucket sort?(a) algorithm implemented for sorting individual buckets(b) number of buckets used(c) distribution of input(d) input valuesI had been asked this question during an online exam.This question is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (d) input values |
|
| 81. |
Which of the following is not true about bucket sort?(a) It is a non comparison based integer sort(b) It is a distribution sort(c) It can also be considered as comparison based sort(d) It is in place sorting algorithmI have been asked this question in a job interview.Query is from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (d) It is in place SORTING algorithm Easiest EXPLANATION - Bucket SORT is a non comparison based integer sort. It sorts the GIVEN data by distributing the array elements into a number of buckets. It is not an in place sorting technique. |
|
| 82. |
How many comparisons will be made to sort the array arr={1, 5, 3, 8, 2} using bucket sort?(a) 5(b) 7(c) 9(d) 0The question was asked in class test.This is a very interesting question from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT option is (d) 0 |
|
| 83. |
What is the alternate name of bucket sort?(a) group sort(b) radix sort(c) bin sort(d) uniform sortI have been asked this question in an online interview.This question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (C) BIN sort |
|
| 84. |
Which of the following algorithm takes non linear time for sorting?(a) counting sort(b) quick sort(c) bucket sort(d) radix sortThe question was posed to me in a job interview.Query is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (b) quick sort |
|
| 85. |
The complexity of which of the following sorting algorithms remains to be the same in its best, average and worst case?(a) quick sort(b) insertion sort(c) counting sort(d) gnome sortThe question was asked in an online interview.Origin of the question is Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» The correct option is (c) COUNTING SORT |
|
| 86. |
What is the average time complexity of counting sort?(a) O(n)(b) O(n+k) k=range of input(c) O(n^2)(d) O(n log n)This question was posed to me in an online interview.Origin of the question is Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) O(n+k) k=range of input |
|
| 87. |
Which of the following uses the largest amount of auxiliary space for sorting?(a) Bubble sort(b) Counting sort(c) Quick sort(d) Heap sortThe question was asked in a national level competition.My question is based upon Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (B) Counting sort |
|
| 88. |
Which of the following sorting techniques is stable?(a) quick sort(b) counting sort(c) heap sort(d) selection sortI have been asked this question in a national level competition.My doubt stems from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» Correct answer is (b) COUNTING sort |
|
| 89. |
It is not possible to implement counting sort when any of the input element has negative value.(a) True(b) FalseThe question was asked in an interview.This intriguing question originated from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» Right CHOICE is (b) False |
|
| 90. |
What is the auxiliary space requirement of counting sort?(a) O(1)(b) O(n)(c) O(log n)(d) O(n+k) k=range of inputI had been asked this question in an international level competition.My question is from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (d) O(n+k) k=range of input |
|
| 91. |
Which of the following sorting techniques is most efficient if the range of input data is not significantly greater than a number of elements to be sorted?(a) selection sort(b) bubble sort(c) counting sort(d) insertion sortThe question was posed to me in an internship interview.This interesting question is from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (c) counting sort |
|
| 92. |
Which of the following is not an example of non comparison sort?(a) bubble sort(b) counting sort(c) radix sort(d) bucket sortI have been asked this question in homework.The doubt is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct option is (a) bubble sort |
|
| 93. |
How many comparisons will be made to sort the array arr={1,5,3,8,2} using counting sort?(a) 5(b) 7(c) 9(d) 0This question was posed to me in an interview for internship.This question is from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (d) 0 |
|
| 94. |
What will be the order of elements of the array arr = {23, 67, 143, 654, 43} after first iteration of MSD sort is complete?(a) 23, 43, 67, 143, 654(b) 23, 67, 43, 143, 654(c) 23, 67, 143, 654, 43(d) 23, 143, 43, 654, 67I got this question in an online quiz.My question is based upon Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (b) 23, 67, 43, 143, 654 |
|
| 95. |
What is the advantage of radix sort over quick sort?(a) radix sort performs better than quick sort when we have log n bits for every digit(b) radix sort has lesser space complexity(c) radix sort is not a comparison based sorting technique(d) radix sort has better cache performance than quick sortThis question was posed to me by my college professor while I was bunking the class.This intriguing question comes from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT option is (a) RADIX SORT performs better than QUICK sort when we have log n bits for every digit Easy explanation - Radix sort performs better than quick sort when we have log n bits for every digit. But radix sort TAKES more space as compared to quick sort. |
|
| 96. |
Which of the following statement is not a stable sorting algorithm?(a) LSD radix sort(b) MSD radix sort(c) Counting sort(d) Pigeonhole sortThe question was asked at a job interview.This question is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» Correct ANSWER is (b) MSD radix sort |
|
| 97. |
MSD radix sort is an in place sorting algorithm.(a) True(b) FalseThis question was addressed to me in an internship interview.The doubt is from Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (b) False |
|
| 98. |
What is the average time complexity of MSD radix sort (w= bits required to store each key)?(a) O(n + w)(b) O(n.w)(c) O(n^2)(d) O(n log n)The question was asked in semester exam.My query is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Correct choice is (B) O(n.w) |
|
| 99. |
MSD radix sort should be preferred over LSD radix sort when we have to maintain the original relative order.(a) True(b) FalseI had been asked this question in a job interview.My doubt is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (B) False |
|
| 100. |
Which of the following is not true about MSD radix sort?(a) its processing starts from the most significant digit(b) it is not a stable sort(c) it is an in place sorting algorithm(d) it is non comparison based sortI got this question in unit test.My doubt stems from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Correct choice is (c) it is an in place sorting ALGORITHM |
|