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. |
Suffix array of the string “statistics” is ____________(a) 2 8 7 4 9 0 5 1 6 3(b) 2 7 4 9 8 0 5 1 6 3(c) 2 4 9 0 5 7 8 1 6 3(d) 2 8 7 0 5 1 6 9 4 3My question is from Arrays Types topic in portion Arrays Types of Data Structures & Algorithms IThis question was posed to me in my homework. |
|
Answer» RIGHT option is (a) 2 8 7 4 9 0 5 1 6 3 Explanation: The suffix array of the string statistics will be: 2 atistics 8 cs 7 ics 4 istics 9 s 0 statistics 5 stics 1 tatistics 6 tics 3 tistics In Suffix array, we only store the indices of suffixes. So, correct option is 2 8 7 4 9 0 5 1 6 3. |
|
| 52. |
Which of the following is false?(a) Suffix array is always sorted(b) Suffix array is used in string matching problems(c) Suffix array is always unsorted(d) Suffix array contains all the suffixes of the given stringMy question is from Arrays Types in chapter Arrays Types of Data Structures & Algorithms II got this question in an interview for internship. |
|
Answer» The correct choice is (C) Suffix array is always unsorted |
|
| 53. |
What is the worst case time complexity of inserting an element into the sorted array?(a) O(nlogn)(b) O(logn)(c) O(n)(d) O(n^2)My question is based upon Parallel Array in chapter Arrays Types of Data Structures & Algorithms IThe question was posed to me in an interview. |
|
Answer» Right OPTION is (c) O(N) |
|
| 54. |
Which of the following is not an application of sorted array?(a) Commercial computing(b) Priority Scheduling(c) Discrete Mathematics(d) Hash TablesMy question comes from Parallel Array in portion Arrays Types of Data Structures & Algorithms II have been asked this question during an interview. |
|
Answer» Right choice is (d) Hash Tables |
|
| 55. |
To search for an element in a sorted array, which searching technique can be used?(a) Linear Search(b) Jump Search(c) Binary Search(d) Fibonacci SearchMy query is from Parallel Array in section Arrays Types of Data Structures & Algorithms II have been asked this question during an interview. |
|
Answer» Correct option is (C) BINARY Search |
|
| 56. |
What is a sorted array?(a) Arrays sorted in numerical order(b) Arrays sorted in alphabetical order(c) Elements of the array are placed at equally spaced addresses in the memory(d) All of the mentionedThis intriguing question comes from Parallel Array in division Arrays Types of Data Structures & Algorithms IThis question was posed to me in an internship interview. |
|
Answer» Correct ANSWER is (d) All of the mentioned |
|
| 57. |
Which of the following arrays are used in the implementation of list data type in python?(a) Bit array(b) Dynamic arrays(c) Sparse arrays(d) Parallel arraysQuestion is taken from Dynamic Array in chapter Arrays Types of Data Structures & Algorithms II got this question by my school principal while I was bunking the class. |
|
Answer» Correct choice is (B) Dynamic ARRAYS |
|
| 58. |
In special case, the time complexity of inserting/deleting elements at the end of dynamic array is __________(a) O (n)(b) O (n^1/2)(c) O (log n)(d) O (1)Question is taken from Dynamic Array topic in division Arrays Types of Data Structures & Algorithms II have been asked this question during an interview. |
|
Answer» Correct CHOICE is (a) O (n) |
|
| 59. |
The growth factor of ArrayList in Java is _______(a) 1(b) 1.5(c) 2(d) 0Origin of the question is Dynamic Array topic in division Arrays Types of Data Structures & Algorithms IThe question was posed to me during a job interview. |
|
Answer» RIGHT answer is (B) 1.5 Explanation: The growth FACTOR of dynamic arrays (Array LIST) in Java is 3/2. The new array capacity is calculated as new_array_size = (old_array_size*3)/2+1. |
|
| 60. |
In which of the following cases dynamic arrays are not preferred?(a) If the size of the array is unknown(b) If the size of the array changes after few iterations(c) If the memory reallocation takes more time i.e. expensive(d) If the array holds less number of elementsThis intriguing question originated from Dynamic Array in portion Arrays Types of Data Structures & Algorithms II had been asked this question during an online exam. |
|
Answer» Correct ANSWER is (d) If the array holds less number of elements |
|
| 61. |
Both Dynamic array and Dynamically memory allocated array are same.(a) True(b) FalseMy enquiry is from Dynamic Array in chapter Arrays Types of Data Structures & Algorithms II had been asked this question in final exam. |
|
Answer» Right option is (B) False |
|
| 62. |
The size of the dynamic array is deallocated if the array size is less than _________% of the backend physical size.(a) 30(b) 40(c) 10(d) 20This interesting question is from Dynamic Array topic in division Arrays Types of Data Structures & Algorithms IThis question was addressed to me by my school teacher while I was bunking the class. |
|
Answer» RIGHT option is (a) 30 Best explanation: The size of the dynamic array is decreased/deallocated if the actual size of the array is less than 30% of the backend physical size. This is USED to AVOID memory wastage. |
|
| 63. |
Dynamic arrays overcome the limit of static arrays.(a) True(b) FalseMy enquiry is from Dynamic Array in chapter Arrays Types of Data Structures & Algorithms IThe question was posed to me in my homework. |
|
Answer» Correct ANSWER is (a) True |
|
| 64. |
What is the time complexity for inserting/deleting at the beginning of the array?(a) O(1)(b) O(n)(c) O(logn)(d) O(nlogn)Question is from Dynamic Array in section Arrays Types of Data Structures & Algorithms II had been asked this question in quiz. |
|
Answer» CORRECT OPTION is (b) O(n) Easiest EXPLANATION - All the other ELEMENTS will have to be moved, hence O(n). |
|
| 65. |
Which of the following is a disadvantage of dynamic arrays?(a) Locality of reference(b) Data cache utilization(c) Random access(d) Memory leakI'd like to ask this question from Dynamic Array in chapter Arrays Types of Data Structures & Algorithms II have been asked this question in an interview for job. |
|
Answer» Right ANSWER is (d) Memory leak |
|
| 66. |
Array is divided into two parts in ____________(a) Hashed Array Tree(b) Geometric Array(c) Bounded-size dynamic array(d) Sparse ArrayI need to ask this question from Dynamic Array in portion Arrays Types of Data Structures & Algorithms IThis question was posed to me in an internship interview. |
|
Answer» The correct choice is (c) Bounded-size dynamic array |
|
| 67. |
Which of the following is the correct syntax to declare an ArrayList in Java?(a) ArrayList al = new ArrayList();(b) ArrayList al = new ArrayList[];(c) ArrayList al() = new ArrayList();(d) ArrayList al[] = new ArrayList[];Question is taken from Dynamic Array in section Arrays Types of Data Structures & Algorithms II have been asked this question in an internship interview. |
|
Answer» The CORRECT option is (a) ArrayList AL = new ArrayList(); |
|
| 68. |
How will you implement dynamic arrays in Java?(a) Set(b) Map(c) HashMap(d) ListMy question is from Dynamic Array in portion Arrays Types of Data Structures & Algorithms IThe question was posed to me in semester exam. |
|
Answer» Correct choice is (d) List |
|
| 69. |
The number of items used by the dynamic array contents is its __________(a) Physical size(b) Capacity(c) Logical size(d) Random sizeThis interesting question is from Dynamic Array topic in section Arrays Types of Data Structures & Algorithms IThis question was posed to me in class test. |
|
Answer» Right answer is (c) LOGICAL SIZE |
|
| 70. |
What is meant by physical size in a dynamic array?(a) The size allocated to elements(b) The size extended to add new elements(c) The size of the underlying array at the back-end(d) The size visible to usersThe origin of the question is Dynamic Array in division Arrays Types of Data Structures & Algorithms IThe question was asked during an interview. |
|
Answer» The correct option is (C) The size of the underlying array at the back-end |
|
| 71. |
What is a dynamic array?(a) A variable size data structure(b) An array which is created at runtime(c) The memory to the array is allocated at runtime(d) An array which is reallocated everytime whenever new elements have to be addedThe origin of the question is Dynamic Array topic in portion Arrays Types of Data Structures & Algorithms IThis question was addressed to me in an online quiz. |
|
Answer» Right option is (a) A variable SIZE data structure |
|
| 72. |
Which one of the following operations returns the first occurrence of bit 1 in bit arrays?(a) Find First Zero(b) Find First One(c) Counting lead Zeroes(d) Counting lead OneThe query is from Bit Array topic in portion Arrays Types of Data Structures & Algorithms IThis question was posed to me by my college director while I was bunking the class. |
|
Answer» The correct option is (b) FIND First One |
|
| 73. |
Bit fields and Bit arrays are same.(a) True(b) FalseMy question is based upon Bit Array topic in division Arrays Types of Data Structures & Algorithms IThe question was posed to me in an interview for internship. |
|
Answer» The correct answer is (b) False |
|
| 74. |
What does Hamming weight/population count mean in Bit arrays?(a) Finding the number of 1 bit in a bit array(b) Finding the number of 0 bit in a bit array(c) Finding the sum of bits in a bit array(d) Finding the average number of 1’s and 0’s in bit arraysThe question is from Bit Array topic in section Arrays Types of Data Structures & Algorithms IThe question was posed to me by my college professor while I was bunking the class. |
|
Answer» Right OPTION is (a) Finding the number of 1 bit in a bit array |
|
| 75. |
Run-Length encoding is used to compress data in bit arrays.(a) True(b) FalseMy question is based upon Bit Array in section Arrays Types of Data Structures & Algorithms IThe question was posed to me by my college professor while I was bunking the class. |
|
Answer» Correct choice is (a) True |
|
| 76. |
Which of the following bitwise operator will you use to invert all the bits in a bit array?(a) OR(b) NOT(c) XOR(d) NANDOrigin of the question is Bit Array topic in division Arrays Types of Data Structures & Algorithms IThis question was addressed to me in exam. |
|
Answer» Correct CHOICE is (b) NOT |
|
| 77. |
Which class in Java can be used to represent bit array?(a) BitSet(b) BitVector(c) BitArray(d) BitStreamThis key question is from Bit Array topic in chapter Arrays Types of Data Structures & Algorithms IThis question was posed to me during an interview. |
|
Answer» The CORRECT choice is (a) BitSet |
|
| 78. |
Which of the following is/are not applications of bit arrays?(a) Used by the Linux kernel(b) For the allocation of memory pages(c) Bloom filter(d) Implementation of Vectors and MatricesI need to ask this question from Bit Array in division Arrays Types of Data Structures & Algorithms IThe question was posed to me during an online interview. |
|
Answer» The correct answer is (d) Implementation of Vectors and Matrices |
|
| 79. |
Which of the following is not a disadvantage of bit array?(a) Without compression, they might become sparse(b) Accessing individual bits is expensive(c) Compressing bit array to byte/word array, the machine also has to support byte/word addressing(d) Storing and Manipulating in the register set for long periods of timeThis interesting question is from Bit Array in portion Arrays Types of Data Structures & Algorithms II had been asked this question in quiz. |
|
Answer» The correct choice is (d) Storing and Manipulating in the register set for long PERIODS of time |
|
| 80. |
Which of the following is not an advantage of bit array?(a) Exploit bit level parallelism(b) Maximal use of data cache(c) Can be stored and manipulated in the register set for long periods of time(d) Accessing Individual Elements is easyMy doubt stems from Bit Array topic in chapter Arrays Types of Data Structures & Algorithms II had been asked this question in an international level competition. |
|
Answer» Correct option is (d) Accessing Individual Elements is easy |
|
| 81. |
Which of the following bitwise operations will you use to toggle a particular bit?(a) OR(b) AND(c) XOR(d) NOTThe question is from Bit Array in section Arrays Types of Data Structures & Algorithms II had been asked this question in an online interview. |
|
Answer» CORRECT OPTION is (c) XOR To explain: 1 XOR 1 = 0, 0 XOR 1 = 1, NOTE that NOT inverts all the bits, while XOR TOGGLES only a specified bit. |
|
| 82. |
Which of the following bitwise operations will you use to set a particular bit to 0?(a) OR(b) AND(c) XOR(d) NANDMy query is from Bit Array in portion Arrays Types of Data Structures & Algorithms IThis question was addressed to me during an interview. |
|
Answer» Correct OPTION is (b) AND |
|
| 83. |
Which of the following bitwise operations will you use to set a particular bit to 1?(a) OR(b) AND(c) XOR(d) NORThis key question is from Bit Array topic in division Arrays Types of Data Structures & Algorithms II got this question in an online interview. |
|
Answer» CORRECT ANSWER is (a) OR The best explanation: 1 OR 1 = 1, 0 OR 1 = 1, any bit OR’ED with 1 GIVES 1. |
|
| 84. |
What is a bit array?(a) Data structure for representing arrays of records(b) Data structure that compactly stores bits(c) An array in which most of the elements have the same value(d) Array in which elements are not present in continuous locationsI'm obligated to ask this question of Bit Array topic in portion Arrays Types of Data Structures & Algorithms II have been asked this question in my homework. |
|
Answer» CORRECT CHOICE is (b) Data structure that compactly STORES bits Easy explanation - It compactly stores bits and EXPLOITS bit-level PARALLELISM. |
|