If you were designing a simple hash function for strings, which operation would likely be a core component?
Reversing the string.
Sorting the characters in the string alphabetically.
Finding the length of the string.
Converting characters to their ASCII codes and performing arithmetic operations.
Which of these is NOT a desirable property of a good hash function?
It should be deterministic (same input always yields the same output).
It should be computationally expensive to calculate.
It should minimize collisions as much as possible.
It should distribute keys uniformly across the hash table.
Which of the following is NOT a collision handling technique in hashmaps?
Open Addressing
Binary Search
Linear Probing
Separate Chaining
Which characteristic of a hash function is undesirable and can lead to performance degradation?
High Collision Rate
Deterministic
Uniform Distribution
Fast Computation
Which of the following operations typically has a time complexity of O(n) in the worst case for a hashmap?
Insertion
All of the above
Deletion
Search
What happens when a hash function produces the same index for different keys?
The key-value pair is discarded.
The hashmap raises an error.
A collision occurs.
The hash function is automatically updated.
In hashmap terminology, what does a 'bucket' typically refer to?
The load factor of the hashmap.
An individual element within the hashmap's array.
A linked list or other data structure used to handle collisions.
The range of possible hash values produced by the hash function.
How are dictionaries typically implemented in programming languages?
Using hashmaps to provide fast key-value lookups.
Using binary trees for sorted key storage.
Using arrays for efficient indexing.
Using linked lists for fast insertions.
Which collision resolution technique is commonly used in hashmaps?
Merge Sort
Bubble Sort
In hashmap collision resolution, what does separate chaining involve?
Creating linked lists at each index of the hash table to store colliding elements.
Finding the next available empty slot in the hash table.
Using a secondary hash function to resolve collisions.
Storing colliding elements in a separate overflow area.