Which collision resolution strategy generally performs better in terms of cache locality?
Separate Chaining
Cache locality is irrelevant to hash tables
Both perform equally well
Open Addressing
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.
Java HashMaps allow null keys and values, while Python dictionaries do not.
Python dictionaries maintain insertion order, while Java HashMaps do not guarantee any specific order.
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.
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.
Employing a bloom filter to quickly identify and discard potentially malicious input.
You are implementing an LRU (Least Recently Used) cache with a fixed capacity. Which data structure combination would be most suitable for efficiently managing the cache?
Hashmap + Stack
Array + Queue
Hashmap + Doubly Linked List
Binary Search Tree + Heap
In a hash table with open addressing using linear probing, suppose we perform a sequence of insertions where each key hashes to the same index. What is the time complexity of the nth insertion in the worst case?
O(n log n)
O(n)
O(1)
O(log n)
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
Double Hashing
What is a common disadvantage of using a hashmap with a poorly chosen hash function?
Frequent hash collisions
Increased memory usage
Slow key generation
Inability to handle duplicate keys
In the context of hash tables, what does a high load factor indicate?
A higher probability of collisions.
Faster insertion operations.
Lower memory usage.
A more efficient hash function is being used.
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?
Array
Queue
Tree
Linked list
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.