Disclaimer:
Educational Use Only:
The website links provided are to be used strictly for educational and knowledge-gaining purposes only.
No Misuse:
Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.
Respect for Websites and Businesses:
Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.
Acknowledge Value of Knowledge:
Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.
No Endorsement:
The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.
User Responsibility:
By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.
Overall MCQs for Reference
- What is a hash table?
a. A structure that maps values to keys
b. A structure that maps keys to values
c. A data structure used for storage
d. A structure used to implement stack and queue
Answer: b. A structure that maps keys to valuessanfoundry+1 - What term describes when multiple elements compete for the same hash table bucket?
a. Diffusion
b. Replication
c. Collision
d. Rehashing
Answer: c. Collisionexamveda+1 - Which is NOT a way to resolve hash table collisions?
a. Separate chaining
b. Linear probing
c. Open addressing
d. Tree mapping
Answer: d. Tree mappingsanfoundry+1 - What is the average time complexity for lookup in a hash table with good hash functions?
a. O(n)
b. O(log n)
c. O(1)
d. O(n log n)
Answer: c. O(1)testbook+1 - Which of these is NOT a typical application of hash tables?
a. Caching
b. Indexing databases
c. Text search
d. Sorting large arrays
Answer: d. Sorting large arraysgeeksforgeeks+1 - What data organization method is used in separate chaining?
a. Stack
b. Array
c. Linked list
d. Tree
Answer: c. Linked listscribd+1 - Which term best describes hash table performance degradation when too many elements are inserted?
a. Load collision
b. Hash overflow
c. Clustering
d. Buffering
Answer: c. Clusteringsanfoundry+1 - In open addressing, if a collision occurs, where is the element stored?
a. At next index
b. At previous index
c. At index zero
d. Using chaining
Answer: a. At next indextestbook+1 - What is meant by the “load factor” of a hash table?
a. Ratio of total slots to filled slots
b. Ratio of filled slots to total slots
c. Number of slots per bucket
d. Number of collisions per operation
Answer: b. Ratio of filled slots to total slotsinterviewbit+1 - Which hashing technique is least prone to clustering?
a. Linear probing
b. Quadratic probing
c. Double hashing
d. Separate chaining
Answer: c. Double hashingtestbook+1 - When would you use rehashing in a hash table?
a. When a lookup fails
b. When a collision occurs
c. When load factor exceeds a threshold
d. When the hash function changes
Answer: c. When load factor exceeds a thresholdgeeksforgeeks+1 - The hash function is best suited for:
a. String keys
b. Integer keys
c. Float keys
d. Complex keys
Answer: b. Integer keystestbook+1 - Which of the following are components of Hashing?
a. Key
b. Hash Function
c. Hash Table
d. All of the above
Answer: d. All of the abovegeeksforgeeks+1 - Why does a hash table need extra memory?
a. To store cache data
b. For indexing arrays
c. For faster access
d. To resolve collisions
Answer: d. To resolve collisionsscribd+1 - In separate chaining, where are collisions stored?
a. Array of arrays
b. Array of stacks
c. Linked lists
d. Binary trees
Answer: c. Linked listssanfoundry+1 - What is the expected time complexity for search in a hash table with separate chaining when the load factor is low?
a. O(1)
b. O(log n)
c. O(n)
d. O(n log n)
Answer: a. O(1)testbook+1 - Which hash table operation typically has constant time complexity?
a. Search
b. Insert
c. Delete
d. All of the above
Answer: d. All of the aboveaimcqs+1 - What is a potential disadvantage of using hash tables?
a. Slow search speed
b. High memory usage
c. Limited key types
d. Complexity of rehashing
Answer: b. High memory usagescribd+1 - Which of the following hash table techniques yields the best performance for fast insertions and searches?
a. Linear probing
b. Quadratic probing
c. Open addressing
d. Double hashing
Answer: d. Double hashingsanfoundry+1 - What is a common characteristic of a good hash function?
a. Easy to compute
b. Distributes keys uniformly
c. Handles collisions poorly
d. Both a and b
Answer: d. Both a and bgeeksforgeeks+1 - In a hash table using open addressing, which technique is used to find the next empty slot?
a. Clustering
b. Probing
c. Linking
d. Searching
Answer: b. Probingtestbook+1 - Which scenario leads to worst-case time complexity for hash tables?
a. When load factor is low
b. When many collisions occur
c. When hash function is good
d. When table size is large
Answer: b. When many collisions occurexamveda+1 - What defines the primary purpose of hashing in data structures?
a. To provide constant time complexity for searches
b. To sort data
c. To encrypt data
d. To compress data
Answer: a. To provide constant time complexity for searchesexamveda+1 - What does “chaining” refer to in hash tables?
a. Linking data in a single array
b. Using multiple hash functions
c. Linking all collided keys via a linked list
d. Storing keys in stack
Answer: c. Linking all collided keys via a linked listscribd+1 - In open addressing, what type of clustering may happen?
a. Primary clustering
b. Secondary clustering
c. Double clustering
d. Uniform clustering
Answer: a. Primary clusteringtestbook+1 - Hash table resizing is typically triggered by:
a. Underflow of load factor
b. Overflow of load factor
c. Poor collision resolution
d. Excess memory
Answer: b. Overflow of load factorgeeksforgeeks+1 - What is the main advantage of hash tables over arrays for search operations?
a. Faster search
b. Better memory utilization
c. Easier sorting
d. Strict ordering
Answer: a. Faster searchaimcqs+1 - The value produced by the hash function is called:
a. Key
b. Index or hash code
c. Value
d. Entry
Answer: b. Index or hash codetestbook+1 - What data structure is typically used for hash table with chaining?
a. Array
b. Linked list
c. Stack
d. Queue
Answer: b. Linked listsanfoundry+1 - Which algorithm is used for open addressing in hash tables?
a. Depth-first search
b. Linear probing
c. Breadth-first search
d. Selection sort
Answer: b. Linear probingtestbook+1 - In which case does quadratic probing help reduce clustering issues?
a. When the table size is very small
b. When collisions occur frequently
c. When clustering is primary
d. When hash function is perfect
Answer: b. When collisions occur frequentlysanfoundry+1 - What best describes the hash table insertion operation?
a. O(n)
b. O(1) on average
c. O(log n)
d. O(n log n)
Answer: b. O(1) on averageaimcqs+1 - Double hashing uses:
a. Two keys
b. Two hash functions
c. Two tables
d. Two linked lists
Answer: b. Two hash functionstestbook+1 - Which scenario is bad for hash table performance?
a. Uniform key distribution
b. Low load factor
c. High collision rate
d. Efficient hash function
Answer: c. High collision rateexamveda+1 - A hash table application in databases helps with:
a. Sorting data efficiently
b. Providing fast access to records
c. Compressing data
d. Encrypting all keys
Answer: b. Providing fast access to recordsgeeksforgeeks+1 - Hash tables use which method to organize elements with identical hash codes?
a. Stacking
b. Chaining
c. Mapping
d. Treeing
Answer: b. Chainingscribd+1 - What is the result when the load factor approaches 1 in a hash table with open addressing?
a. More clustering and reduced efficiency
b. Decreased collisions
c. Constant time performance
d. Greater memory savings
Answer: a. More clustering and reduced efficiencytestbook+1 - Which type of hash table collision resolution offers less memory overhead?
a. Chaining
b. Linear probing
c. Open addressing
d. Quadratic probing
Answer: c. Open addressingsanfoundry+1 - The ideal hash table size is:
a. A prime number
b. An even number
c. Power of two
d. Any large number
Answer: a. A prime numbergeeksforgeeks+1 - Which is TRUE about hash tables?
a. They guarantee no collisions
b. They rely on hash functions for mapping keys to slots
c. They are always faster than binary trees
d. Load factor is always zero
Answer: b. They rely on hash functions for mapping keys to slotstestbook+1 - Which operation is delayed or complicated with hash tables compared to sequential structures?
a. Search
b. Deletion
c. Sorting
d. Insertion
Answer: c. Sortinggeeksforgeeks+1 - What can happen if too many collisions occur in hash tables?
a. Constant lookup time
b. Performance approaching search in linked lists
c. Increased hashing efficiency
d. Fewer entries permitted
Answer: b. Performance approaching search in linked listssanfoundry+1 - In the hash table context, what is “rehashing”?
a. Changing hash function
b. Increasing table size and redistributing entries
c. Sorting the table
d. Removing all items
Answer: b. Increasing table size and redistributing entriestestbook+1 - What is the hash code used for?
a. Sorting keys
b. Determining storage index
c. Encrypting keys
d. Counting collisions
Answer: b. Determining storage indexgeeksforgeeks+1 - Separate chaining uses which two primary structures?
a. Arrays and stacks
b. Arrays and linked lists
c. Arrays and queues
d. Arrays and trees
Answer: b. Arrays and linked listsscribd+1 - What is the main reason for poor hash table performance?
a. Small table size
b. Poor hash function selection
c. Low load factor
d. Large prime table size
Answer: b. Poor hash function selectiontestbook+1 - What results in secondary clustering in hash tables?
a. Linear probing
b. Quadratic probing
c. Double hashing
d. Chaining
Answer: b. Quadratic probingsanfoundry+1 - Which component is NOT used in hash table design?
a. Key
b. Hash function
c. Sorting algorithm
d. Storage array
Answer: c. Sorting algorithmgeeksforgeeks+1 - What method is often used for collision resolution in hash tables with integer keys?
a. Separate chaining
b. Open addressing
c. Doubly linked list
d. Sorting
Answer: a. Separate chainingsanfoundry+1 - Which situation warrants increasing hash table size?
a. Decreasing number of elements
b. High load factor due to added elements
c. Efficient hash function
d. Low collision rates
Answer: b. High load factor due to added elementstestbook+1
- https://www.sanfoundry.com/data-structure-questions-answers-hash-tables/
- https://erp.metbhujbalknowledgecity.ac.in/StudyMaterial/01SJ072012006800108.pdf
- https://www.examveda.com/data-structure/practice-mcq-question-on-hashing/
- https://www.sanfoundry.com/hash-tables-chaining-linked-lists-multiple-choice-questions-answers-mcqs/
- https://testbook.com/objective-questions/mcq-on-hashing–5eea6a0c39140f30f369e0c1
- https://aimcqs.com/data-structures
- https://www.geeksforgeeks.org/quizzes/top-mcqs-on-hash-data-strcuture-with-answers/
- https://www.scribd.com/document/783318391/Data-Structure-Multiple-Choice-Questions-and-Answers
- https://testbook.com/objective-questions/mcq-on-hashing–5eea6a0939140f30f369da76
- https://www.interviewbit.com/data-structure-mcq/
- https://testbook.com/question-answer/consider-the-hash-table-of-size-11-that-uses-open–63e4d862acea6943b36b21d7
- https://www.examveda.com/data-structure/practice-mcq-question-on-hashing/?section=2
- https://www.scribd.com/document/899121437/Top-MCQs-on-Hash-Data-Strcuture-With-Answers
- https://study.com/academy/practice/quiz-worksheet-hash-tables-overview.html
- https://www.geeksforgeeks.org/dsa/practice-problems-on-hashing/
- https://www.scribd.com/document/407788982/Data-Structure-Questions-and-Answers-docx
- https://www.youtube.com/watch?v=4quPv_yilRs
- https://wayground.com/admin/quiz/6620dfca5f1f2301a7bb4345/hash-tables