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. |
What can be the value of m in the division method?(a) Any prime number(b) Any even number(c) 2^p – 1(d) 2^pI want to ask this question from Hash Tables in section Hash Tables of Data Structures & Algorithms II have been asked this question in unit test. |
|
Answer» Correct option is (a) Any prime number |
|
| 102. |
What is the hash function used in the division method?(a) h(k) = k/m(b) h(k) = k mod m(c) h(k) = m/k(d) h(k) = mmod kMy question comes from Hash Tables topic in portion Hash Tables of Data Structures & Algorithms II have been asked this question in quiz. |
|
Answer» Correct choice is (b) H(k) = k MOD m |
|
| 103. |
A good hash approach is to derive the hash value that is expected to be dependent of any patterns that might exist in the data.(a) True(b) FalseThis interesting question is from Hash Tables topic in portion Hash Tables of Data Structures & Algorithms IThis question was addressed to me in final exam. |
|
Answer» Correct answer is (B) False |
|
| 104. |
Which hash function satisfies the condition of simple uniform hashing?(a) h(k) = lowerbound(km)(b) h(k)= upperbound(mk)(c) h(k)= lowerbound(k)(d) h(k)= upperbound(k)I would like to ask this question from Hash Tables in chapter Hash Tables of Data Structures & Algorithms II got this question during an interview. |
|
Answer» correct OPTION is: (a) h(K) = lowerbound(km) If the keys are KNOWN to be random real numbers k independently and UNIFORMLY distributed in the range 0<=k<=1, the HASH function which satisfies the condition of simple uniform hashing is h(k)= lowerbound(km). |
|
| 105. |
Which scheme uses a randomization approach?(a) hashing by division(b) hashing by multiplication(c) universal hashing(d) open addressingMy question comes from Hash Tables topic in chapter Hash Tables of Data Structures & Algorithms II have been asked this question in semester exam. |
|
Answer» CORRECT OPTION is (c) universal hashing The BEST I can explain: Universal hashing SCHEME uses a randomization approach whereas hashing by division and hashing by multiplication are heuristic in nature. |
|
| 106. |
What is the formula used in quadratic probing?(a) Hash key = key mod table size(b) Hash key=(hash(x)+F(i)) mod table size(c) Hash key=(hash(x)+F(i^2)) mod table size(d) H(x) = x mod 17The above asked question is from Hash Tables topic in portion Hash Tables of Data Structures & Algorithms II had been asked this question during an online exam. |
|
Answer» Right ANSWER is (c) Hash key=(hash(X)+F(i^2)) mod table size |
|
| 107. |
Which of the following techniques offer better cache performance?(a) Quadratic probing(b) Linear probing(c) Double hashing(d) RehashingMy question is based upon Hash Tables topic in portion Hash Tables of Data Structures & Algorithms II got this question in quiz. |
|
Answer» Correct choice is (B) LINEAR probing |
|
| 108. |
Which among the following is the best technique to handle collision?(a) Quadratic probing(b) Linear probing(c) Double hashing(d) Separate chainingThis question is from Hash Tables topic in division Hash Tables of Data Structures & Algorithms IThis question was addressed to me in my homework. |
|
Answer» The CORRECT answer is (a) Quadratic PROBING |
|
| 109. |
How many constraints are to be met to successfully implement quadratic probing?(a) 1(b) 2(c) 3(d) 4This interesting question is from Hash Tables in division Hash Tables of Data Structures & Algorithms IThe question was posed to me in an internship interview. |
|
Answer» Correct OPTION is (b) 2 |
|
| 110. |
Which of the following is the correct function definition for quadratic probing?(a) F(i)=i^2(b) F(i)=i(c) F(i)=i+1(d) F(i)=i^2+1The doubt is from Hash Tables topic in portion Hash Tables of Data Structures & Algorithms II have been asked this question in exam. |
|
Answer» The CORRECT option is (a) F(i)=i^2 |
|
| 111. |
In quadratic probing, if the table size is prime, a new element cannot be inserted if the table is half full.(a) True(b) FalseThe above asked question is from Hash Tables in portion Hash Tables of Data Structures & Algorithms IThis question was posed to me in examination. |
|
Answer» The correct ANSWER is (b) False |
|
| 112. |
What kind of deletion is implemented by hashing using open addressing?(a) active deletion(b) standard deletion(c) lazy deletion(d) no deletionMy query is from Hash Tables in division Hash Tables of Data Structures & Algorithms II have been asked this question by my college director while I was bunking the class. |
|
Answer» Correct option is (C) lazy deletion |
|
| 113. |
Quadratic probing overcomes primary collision.(a) True(b) FalseThis intriguing question originated from Hash Tables in chapter Hash Tables of Data Structures & Algorithms II got this question in an online interview. |
|
Answer» Correct option is (a) True |
|
| 114. |
Which of the following schemes does quadratic probing come under?(a) rehashing(b) extended hashing(c) separate chaining(d) open addressingThis key question is from Hash Tables in chapter Hash Tables of Data Structures & Algorithms II have been asked this question in an internship interview. |
|
Answer» Correct option is (d) open addressing |
|
| 115. |
What is the formula to find the expected number of probes for an unsuccessful search in linear probing?(a) \(\frac{1}{2} \frac{1+1}{(1-⅄)}\)(b) \(\frac{1}{2}\frac{1+1}{(1-⅄)^2}\)(c) \(\frac{1}{2}\frac{1+1}{(1+⅄)}\)(d) \(\frac{1}{2}\frac{1+1}{(1+⅄)(1-⅄)}\)My question is based upon Hash Tables in section Hash Tables of Data Structures & Algorithms II got this question during an online interview. |
|
Answer» The CORRECT option is (b) \(\frac{1}{2}\frac{1+1}{(1-⅄)^2}\) |
|
| 116. |
Hashing can be used in online spelling checkers.(a) True(b) FalseMy doubt stems from Hash Tables topic in division Hash Tables of Data Structures & Algorithms II had been asked this question in homework. |
|
Answer» RIGHT choice is (a) True The best I can EXPLAIN: If MISSPELLING detection is important, an entire dictionary can be pre-hashed and words can be CHECKED in constant TIME. |
|
| 117. |
What is the hash function used in linear probing?(a) H(x)= key mod table size(b) H(x)= (key+ F(i^2)) mod table size(c) H(x)= (key+ F(i)) mod table size(d) H(x)= X mod 17I'd like to ask this question from Hash Tables in division Hash Tables of Data Structures & Algorithms IThis question was posed to me during an online exam. |
|
Answer» Correct CHOICE is (c) H(x)= (key+ F(i)) mod table size |
|
| 118. |
___________is not a theoretical problem but actually occurs in real implementations of probing.(a) Hashing(b) Clustering(c) Rehashing(d) CollisionThis question is from Hash Tables topic in section Hash Tables of Data Structures & Algorithms II had been asked this question in an online interview. |
|
Answer» CORRECT CHOICE is (b) Clustering Easiest EXPLANATION - Clustering is not a theoretical PROBLEM but it occurs in implementations of hashing. Rehashing is a kind of hashing. |
|
| 119. |
Which of the following is the correct function definition for linear probing?(a) F(i)= 1(b) F(i)=i(c) F(i)=i^2(d) F(i)=i+1I want to ask this question from Hash Tables topic in section Hash Tables of Data Structures & Algorithms IThis question was addressed to me in final exam. |
|
Answer» Right ANSWER is (B) F(i)=i |
|
| 120. |
In linear probing, the cost of an unsuccessful search can be used to compute the average cost of a successful search.(a) True(b) FalseThe above asked question is from Hash Tables topic in section Hash Tables of Data Structures & Algorithms II have been asked this question in quiz. |
|
Answer» Right choice is (a) True |
|
| 121. |
Which of the following is not a collision resolution strategy for open addressing?(a) Linear probing(b) Quadratic probing(c) Double hashing(d) RehashingI need to ask this question from Hash Tables in division Hash Tables of Data Structures & Algorithms II got this question at a job interview. |
|
Answer» The correct option is (d) Rehashing |
|
| 122. |
What is the load factor for an open addressing technique?(a) 1(b) 0.5(c) 1.5(d) 0I want to ask this question from Hash Tables topic in section Hash Tables of Data Structures & Algorithms IThis question was posed to me during an interview. |
|
Answer» RIGHT answer is (b) 0.5 The best EXPLANATION: The load factor for an OPEN addressing TECHNIQUE should be 0.5. For separate CHAINING technique, the load factor is 1. |
|
| 123. |
How many probes are required on average for insertion and successful search?(a) 4 and 10(b) 2 and 6(c) 2.5 and 1.5(d) 3.5 and 1.5My question comes from Hash Tables topic in portion Hash Tables of Data Structures & Algorithms IThe question was asked in an online interview. |
|
Answer» The correct option is (C) 2.5 and 1.5 |
|
| 124. |
Which of the following problems occur due to linear probing?(a) Primary collision(b) Secondary collision(c) Separate chaining(d) Extendible hashingMy doubt stems from Hash Tables in portion Hash Tables of Data Structures & Algorithms II had been asked this question in unit test. |
|
Answer» The CORRECT ANSWER is (a) Primary collision |
|