How does using a cryptographic hash function with a random salt improve the security of a hashmap storing user credentials?
It eliminates the possibility of hash collisions.
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.
In the context of hashmaps, what is a 'universal hash function' primarily designed to protect against?
Attempts to guess the keys used in the hashmap by analyzing the distribution of hashed values.
Denial-of-service attacks caused by hash flooding.
Collisions caused by malicious input specifically crafted to exploit a known hash function.
Data corruption caused by accidental hash collisions between legitimate inputs.
In cuckoo hashing, how many hash functions are typically used?
2
It depends on the size of the hash table.
3
1
What is the primary reason for using a prime number as the size of a hash table in many implementations?
To ensure an even distribution of keys across the hash table, reducing collisions.
To make the implementation of the hash table simpler.
To minimize the memory usage of the hash table.
To increase the speed of hash function computation.
Which of the following statements accurately describes a key difference in the behavior of Python dictionaries and Java HashMaps?
Python dictionaries use separate chaining for collision resolution, while Java HashMaps employ open addressing.
Java HashMaps are synchronized and thread-safe, whereas Python dictionaries are not.
Python dictionaries maintain insertion order, while Java HashMaps do not guarantee any specific order.
Java HashMaps allow null keys and values, while Python dictionaries do not.
Why is it generally recommended to avoid using mutable objects as keys in hash tables?
Using mutable keys increases the memory overhead of the hash table.
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.
Mutable keys make the implementation of the hash table significantly more complex.
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
Separate Chaining
Double Hashing
Linear Probing
Which of the following is NOT a valid mitigation strategy against hash flooding attacks?
Employing a bloom filter to quickly identify and discard potentially malicious input.
Using a fixed-size hashmap to limit the maximum number of collisions.
Switching to a different data structure like a tree-based map that offers consistent performance.
Implementing a random salt value in the hash function to make collisions unpredictable.
In a hash table using double hashing, the second hash function is used to:
Generate a new key if a collision occurs.
Determine the step size for probing in case of a collision.
Calculate the size of the hash table.
Determine the initial index to store the key.
In a web server implemented using a hashmap to store cached web pages, which collision resolution strategy is generally preferred for its performance in handling a high volume of concurrent requests?
Separate Chaining with balanced binary search trees
Open Addressing with linear probing
Separate Chaining with linked lists