How does using a cryptographic hash function with a random salt improve the security of a hashmap storing user credentials?
It makes it significantly harder for attackers to perform rainbow table attacks.
It encrypts the data stored in the hashmap, making it unreadable without the decryption key.
It prevents unauthorized users from accessing the hashmap's keys.
It eliminates the possibility of hash collisions.
How can a hash flooding attack impact the performance of a web server using a hashmap to store session data?
It has no impact on performance, as hash flooding attacks only target data integrity.
It can improve the efficiency of the hashmap by distributing data more evenly.
It can lead to increased memory usage and faster response times.
It can cause a denial-of-service by forcing the server to handle a large number of collisions.
In cuckoo hashing, how many hash functions are typically used?
3
1
2
It depends on the size of the hash table.
In Python, what is the purpose of the __hash__ method when used in conjunction with dictionaries?
__hash__
To determine the maximum number of elements that can be stored in the dictionary before resizing.
To specify how a custom object should be converted into a hash value for use as a key.
To define a custom sorting order for keys in the dictionary.
To provide a mechanism for iterating over the key-value pairs in the dictionary.
You are designing a system to store and retrieve frequently accessed data with high performance. Which of the following hash table collision resolution strategies would generally offer the BEST performance under high load factors?
Quadratic Probing
Double Hashing
Linear Probing
Separate Chaining
What is the primary reason for using a prime number as the size of a hash table in many implementations?
To minimize the memory usage of the hash table.
To increase the speed of hash function computation.
To ensure an even distribution of keys across the hash table, reducing collisions.
To make the implementation of the hash table simpler.
Why is it generally recommended to avoid using mutable objects as keys in hash tables?
Mutable keys make the implementation of the hash table significantly more complex.
Hash tables cannot store mutable objects as keys; only immutable objects are allowed.
Mutable keys can lead to inconsistent state if their values are modified after being inserted into the hash table.
Using mutable keys increases the memory overhead of the hash table.
What is a common disadvantage of using a hashmap with a poorly chosen hash function?
Increased memory usage
Slow key generation
Inability to handle duplicate keys
Frequent hash collisions
In the context of hashmaps, what is a 'universal hash function' primarily designed to protect against?
Collisions caused by malicious input specifically crafted to exploit a known hash function.
Denial-of-service attacks caused by hash flooding.
Data corruption caused by accidental hash collisions between legitimate inputs.
Attempts to guess the keys used in the hashmap by analyzing the distribution of hashed values.
Which of these data structures can provide a more secure and performant alternative to a hashmap when handling user authentication data, especially in scenarios prone to hash flooding attacks?
Tree
Linked list
Queue
Array