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.
| 101. |
Which of the following is an alternate name of MSD radix sort?(a) bottom up radix sort(b) top down radix sort(c) forward radix sort(d) backward radix sortI got this question by my college director while I was bunking the class.The above asked question is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (b) TOP down radix sort Explanation: Top down radix sort is an ALTERNATE name of MSD radix sort. It is because in this ALGORITHM the processing starts from the most significant digit and end at least significant digit. |
|
| 102. |
Which of the following is the most suitable definition of radix sort?(a) It is a non comparison based integer sort(b) It is a comparison based integer sort(c) It is a non comparison based non integer sort(d) It is a comparison based non integer sortThis question was posed to me in unit test.This key question is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (a) It is a non comparison based integer sort |
|
| 103. |
Which of the following combines qualities of MSD radix sort and LSD radix sort?(a) in-place MSD radix sort(b) stable MSD radix sot(c) 3 way radix quick sort(d) forward radix sortThis question was posed to me during an online interview.This interesting question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Correct ANSWER is (d) FORWARD radix SORT |
|
| 104. |
What is the full form of MSD in MSD radix sort?(a) most significant digit(b) many significant digit(c) more significant digit(d) must significant digitThis question was posed to me in an interview.I need to ask this question from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (a) most SIGNIFICANT digit |
|
| 105. |
How many comparisons will be made to sort the array arr = {1, 5, 3, 8, 2} using MSD radix sort?(a) 5(b) 7(c) 9(d) 0I got this question in an interview for internship.My question is taken from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (d) 0 |
|
| 106. |
LSD radix sort is in-place sorting algorithm.(a) False(b) TrueI got this question in a national level competition.The above asked question is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (a) False |
|
| 107. |
Which of the following is true for the LSD radix sort?(a) works best for variable length strings(b) accesses memory randomly(c) inner loop has less instructions(d) sorts the keys in left-to-right orderThe question was posed to me in examination.My query is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT choice is (b) accesses memory randomly The explanation is: LSD radix sort SORTS the keys in right-to-left order, working with Least Significant Digit first. The inner LOOP has a lot of instructions and LSD radix sort is USED to sort fixed-length strings. |
|
| 108. |
Which of the following is a combination of LSD and MSD radix sorts?(a) Forward radix sort(b) 3-way radix quick sort(c) Trie base radix sort(d) Flash sortThe question was posed to me in a job interview.My question is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (a) FORWARD radix sort |
|
| 109. |
Which of the following should be used to sort a huge database on a fixed-length key field?(a) Insertion sort(b) Merge sort(c) LSD radix sort(d) Quick sortThis question was addressed to me during an online exam.This interesting question is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT ANSWER is (c) LSD radix SORT |
|
| 110. |
LSD radix sort is faster than comparison sorts.(a) True(b) FalseI had been asked this question in an international level competition.This key question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) False |
|
| 111. |
Which of the following sorting algorithm is stable?(a) Heap sort(b) Selection sort(c) In-place MSD radix sort(d) LSD radix sortThe question was posed to me in an online interview.My question is taken from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (d) LSD radix sort |
|
| 112. |
Which of the following is false?(a) LSD radix sort is an integer sorting algorithm(b) LSD radix sort is a comparison sorting algorithm(c) LSD radix sort is a distribution sort(d) LSD radix sort uses bucket sortI had been asked this question in quiz.My question is taken from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (b) LSD radix SORT is a COMPARISON sorting algorithm |
|
| 113. |
LSD radix sort requires _____ passes to sort N elements.(a) (w/logR)(b) N(w/logR)(c) (w/log(RN))(d) (wN/log(N))I have been asked this question by my college director while I was bunking the class.My question comes from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT option is (a) (W/logR) The best I can explain: LSD radix sort sorts the N elements in(w/logR) passes where w is the number of digits in largest number and R(radix) is extra space required for performing the SORTING OPERATION. |
|
| 114. |
What is the worst case time complexity of LSD radix sort?(a) O(nlogn)(b) O(wn)(c) O(n)(d) O(n + w)I got this question in a job interview.Query is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (b) O(wn) |
|
| 115. |
Which of the following is the distribution sort?(a) Heap sort(b) Smooth sort(c) Quick sort(d) LSD radix sortThis question was addressed to me by my college director while I was bunking the class.I want to ask this question from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» Correct CHOICE is (d) LSD radix sort |
|
| 116. |
What is the average time complexity of pigeonhole sort (k=range of input)?(a) O(n)(b) O(n+k)(c) O(n^2)(d) O(n*k)The question was asked in examination.Asked question is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT answer is (b) O(N+k) |
|
| 117. |
Pigeonhole sort is an in place sorting algorithm.(a) true(b) falseThis question was posed to me during an interview for a job.This interesting question is from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The correct option is (b) false |
|
| 118. |
Pigeonhole sort is a stable sorting algorithm.(a) true(b) falseI have been asked this question in exam.The query is from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Correct OPTION is (a) true |
|
| 119. |
The auxiliary array used in pigeonhole sorting is called ______________(a) bucket(b) pigeon(c) hole(d) pigeonholeThe question was posed to me by my school teacher while I was bunking the class.Question is taken from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (d) pigeonhole |
|
| 120. |
What is the space complexity of pigeonhole sort (k=range of input)?(a) O(n*k)(b) O(n)(c) O(k)(d) O(n+k)I had been asked this question in an internship interview.My enquiry is from Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (d) O(n+k) |
|
| 121. |
In which of the following case pigeonhole sort is most efficient?(a) when range of input is less than number of elements(b) when range of input is more than number of elements(c) when range of input is comparable to the number of elements(d) when the given array is almost sortedI had been asked this question during an online exam.Question is taken from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT choice is (c) when range of input is COMPARABLE to the NUMBER of elements |
|
| 122. |
Which of the following is a non-comparison sort?(a) heap sort(b) quick sort(c) merge sort(d) pigeonhole sortThe question was posed to me in an interview for internship.Question is from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct option is (d) pigeonhole sort |
|
| 123. |
How many comparisons will be made to sort the array arr={1,5,3,8,2} using pigeonhole sort?(a) 5(b) 7(c) 9(d) 0The question was asked in final exam.This intriguing question originated from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Correct CHOICE is (d) 0 |
|
| 124. |
Sleep sort is an in-place sorting technique.(a) True(b) FalseThis question was addressed to me by my school principal while I was bunking the class.I need to ask this question from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (a) True |
|
| 125. |
Which of the following sorting algorithm is most closely related to the OS?(a) gnome sort(b) sleep sort(c) radix sort(d) bogo sortI had been asked this question in unit test.My question is taken from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (b) SLEEP SORT |
|
| 126. |
Sleep sort does gives a correct output when ___________(a) any input element is negative(b) input array is reverse sorted(c) any input element is positive(d) when there is a very small number to the left of very large numberI have been asked this question by my college professor while I was bunking the class.My query is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT CHOICE is (C) any input element is positive |
|
| 127. |
Auxiliary space requirement of sleep sort is ___________(a) O(n)(b) O(1)(c) O(max(input))(d) O(log n)I had been asked this question by my college professor while I was bunking the class.I'd like to ask this question from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) O(1) |
|
| 128. |
Sleep sort can be preferred over which of the following sorting algorithms for large number of input elements?(a) Quick sort(b) Bubble sort(c) Selection sort(d) No sorting algorithm is preferredThis question was addressed to me in a national level competition.My question comes from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (d) No SORTING algorithm is preferred |
|
| 129. |
Time complexity of sleep sort can be approximated to be ___________(a) O(n + max(input))(b) O(n^2)(c) O(n log n + max(input))(d) O(n log n)The question was posed to me in semester exam.Question is from Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (c) O(n log n + MAX(input)) |
|
| 130. |
Sleep sort code cannot compile online because ___________(a) it has very high time complexity(b) it has very high space complexity(c) it requires multithreading process(d) online compilers are not efficientThe question was posed to me in unit test.My question is based upon Sorting topic in portion Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT answer is (C) it requires multithreading process |
|
| 131. |
Sleep sort works by ___________(a) making elements to sleep for a time that is proportional to their magnitude(b) making elements to sleep for a time that is inversely proportional to their magnitude(c) partitioning the input array(d) dividing the value of input elementsThe question was posed to me in exam.Asked question is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT option is (a) making elements to SLEEP for a time that is proportional to their magnitude |
|
| 132. |
In how many comparisons does the array arr={1,4,2,3,5} gets sorted if we use sleep sort?(a) 5(b) 3(c) 1(d) 0The question was asked during an interview for a job.My doubt is from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (d) 0 |
|
| 133. |
Sleep sort does not work for ___________(a) negative numbers(b) large numbers(c) small numbers(d) positive numbersThe question was posed to me at a job interview.Question is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (a) negative NUMBERS |
|
| 134. |
Which of the following header file is a must to implement sleep sort algorithm?(a) string.h(b) math.hw(c) bios.h(d) windows.hThis question was addressed to me during an interview.My question is taken from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT CHOICE is (d) windows.h The explanation is: To implement sleep sort algorithm we NEED functions like WaitForMultipleObjects(), _beginthread(). These are INCLUDED in the header FILE windows.h. |
|
| 135. |
What is the worst case time complexity of bogosort?(a) O(n^2)(b) O(n*n!)(c) O(infinity)(d) O(n log n)This question was addressed to me in an interview for internship.My doubt is from Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» The correct option is (c) O(infinity) |
|
| 136. |
What is the best case time complexity of bogosort?(a) O(n^2)(b) O(n)(c) O(n log n)(d) O(1)The question was asked in an international level competition.My question is based upon Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» Correct ANSWER is (b) O(n) |
|
| 137. |
What is the auxiliary space requirement of bogosort?(a) O(n)(b) O(1)(c) O(log n)(d) O(n log n)I had been asked this question by my school principal while I was bunking the class.Asked question is from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» Correct answer is (b) O(1) |
|
| 138. |
Bogosort works by __________(a) generating random permutations of its input(b) partitioning the array(c) dividing the value of input elements(d) generating permutations according to the value of first element of arrayThe question was asked in examination.The query is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT choice is (a) generating random permutations of its INPUT Explanation: Bogosort algorithm successively generates permutations of its input. This PROCESS is repeated until the sorted version of the ARRAY is FOUND. |
|
| 139. |
Which of the following is not an alternative name of bogosort?(a) stupid sort(b) permutation sort(c) donkey sort(d) monkey sortThe question was posed to me in an interview.This is a very interesting question from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» The correct option is (c) donkey sort |
|
| 140. |
What is the average case time complexity of gnome sort?(a) O(n)(b) O(n^2)(c) O(n log n)(d) O(log n)This question was posed to me in an interview for internship.This intriguing question comes from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The correct choice is (b) O(n^2) |
|
| 141. |
Auxiliary space used by gnome sort is _________(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)I have been asked this question in an interview.This key question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Right CHOICE is (a) O(1) |
|
| 142. |
Which of the following pair of sorting algorithms are stable?(a) gnome sort and quick sort(b) merge sort and selection sort(c) gnome sort and merge sort(d) heap sort and merge sortI got this question by my college director while I was bunking the class.I'd like to ask this question from Sorting in division Sorting of Data Structures & Algorithms II |
|
Answer» Right OPTION is (c) gnome sort and merge sort |
|
| 143. |
How many loops are required to implement gnome sorting algorithm?(a) Single loop(b) 2 nested loops(c) 3 nested loops(d) It does not require any loopI had been asked this question in quiz.The query is from Sorting topic in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (a) Single loop |
|
| 144. |
Gnome sort is also called __________(a) Smart sort(b) Stupid sort(c) Bogo sort(d) Special sortI got this question in an international level competition.Query is from Sorting in chapter Sorting of Data Structures & Algorithms II |
|
Answer» Right choice is (b) Stupid sort |
|
| 145. |
What is the advantage of comb sort over merge sort?(a) Comb sort is an in place sorting algorithm(b) Comb sort is a stable sorting algorithm(c) Comb sort is more efficient(d) It has no advantageThe question was posed to me in class test.I'd like to ask this question from Sorting topic in section Sorting of Data Structures & Algorithms II |
|
Answer» RIGHT choice is (a) Comb sort is an in PLACE sorting algorithm The best explanation: Comb sort does not require AUXILIARY space for manipulating input so it is an in place sorting algorithm but MERGE sort does require O(n) of auxiliary space which makes comb sort better in terms of space complexity. |
|
| 146. |
What is the best case time complexity of comb sort and bubble sort respectively?(a) O(n^2) and O(n log n)(b) O(n log n) and O(n)(c) O(n) and O(n^2)(d) O(n^2/2^a) (a=number of increment) and O(n^2)The question was posed to me in class test.My doubt is from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct OPTION is (b) O(n LOG n) and O(n) |
|
| 147. |
Comb sort is a stable sorting algorithm.(a) True(b) FalseI have been asked this question in unit test.Enquiry is from Sorting in section Sorting of Data Structures & Algorithms II |
|
Answer» The CORRECT option is (b) False |
|
| 148. |
The given array is arr={7,4,5,8,1,2}. The number of iterations required to sort the array using comb sort and bubble sort respectively will be _______(a) 7 and 8(b) 5 and 6(c) 5 and 5(d) 4 and 5I got this question in an interview for internship.The above asked question is from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» The correct answer is (d) 4 and 5 |
|
| 149. |
Auxiliary space used by comb sort is _______(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)I got this question in an interview for internship.This key question is from Sorting topic in division Sorting of Data Structures & Algorithms II |
|
Answer» Right answer is (a) O(1) |
|
| 150. |
The gap value after 3 iterations in an array with 6 elements will be _______(a) 4(b) 3(c) 2(d) 1This question was posed to me by my school principal while I was bunking the class.This key question is from Sorting in portion Sorting of Data Structures & Algorithms II |
|
Answer» Right option is (c) 2 |
|