In the context of hash tables, what does a high load factor indicate?
A higher probability of collisions.
Lower memory usage.
A more efficient hash function is being used.
Faster insertion operations.
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
Queue
Linked list
Array
In a hashmap implementation using open addressing with linear probing, what is the worst-case time complexity for searching for a key if the hash table is nearly full?
O(1)
O(n)
O(log n)
O(n log n)
What security risk arises from storing sensitive data like passwords directly in a hashmap, even when hashed?
Storing any data in a hashmap increases the risk of SQL injection attacks.
Hashmaps are inherently less secure than other data structures for storing passwords.
Hash collisions could allow attackers to bypass authentication.
An attacker gaining access to the hashmap could retrieve the plaintext passwords.
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 make the implementation of the hash table simpler.
To increase the speed of hash function computation.
To ensure an even distribution of keys across the hash table, reducing collisions.
What is the primary advantage of using a universal hash function?
It provides better performance than any single, fixed hash function.
It makes the hash table resistant to attacks that exploit patterns in the hash function.
It ensures constant-time performance for all operations.
It eliminates the possibility of collisions entirely.
Which of the following is NOT a valid mitigation strategy against hash flooding attacks?
Switching to a different data structure like a tree-based map that offers consistent performance.
Employing a bloom filter to quickly identify and discard potentially malicious input.
Using a fixed-size hashmap to limit the maximum number of collisions.
Implementing a random salt value in the hash function to make collisions unpredictable.
What mechanism does Java's ConcurrentHashMap employ to allow for concurrent reads and updates while maintaining thread safety?
Read-write locks separating readers and writers
Fine-grained locking at the bucket level
A single global lock for all operations
Lock-free data structures using atomic operations
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 prevents unauthorized users from accessing the hashmap's keys.
It eliminates the possibility of hash collisions.
It encrypts the data stored in the hashmap, making it unreadable without the decryption key.
Hopscotch hashing aims to improve the performance of open addressing by:
Limiting the maximum distance a key can be placed from its original hash index.
Using multiple hash tables to store keys with different hash values.
Using a dynamic array to resize the table when the load factor gets high.
Employing a binary search tree for efficient collision resolution.