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)
Which collision resolution strategy generally performs better in terms of cache locality?
Separate Chaining
Open Addressing
Both perform equally well
Cache locality is irrelevant to hash tables
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.
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.
Java HashMaps are synchronized and thread-safe, whereas Python dictionaries are not.
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?
Double Hashing
Separate Chaining with balanced binary search trees
Open Addressing with linear probing
Separate Chaining with linked lists
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?
Hopscotch hashing aims to improve the performance of open addressing by:
Using a dynamic array to resize the table when the load factor gets high.
Employing a binary search tree for efficient collision resolution.
Using multiple hash tables to store keys with different hash values.
Limiting the maximum distance a key can be placed from its original hash index.
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?
Linear Probing
Quadratic Probing
In the context of hash tables, what does a high load factor indicate?
Faster insertion operations.
A more efficient hash function is being used.
A higher probability of collisions.
Lower memory usage.
How does using a cryptographic hash function with a random salt improve the security of a hashmap storing user credentials?
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.
It makes it significantly harder for attackers to perform rainbow table attacks.
In the context of hashmaps, what is a 'universal hash function' primarily designed to protect against?
Denial-of-service attacks caused by hash flooding.
Attempts to guess the keys used in the hashmap by analyzing the distribution of hashed values.
Collisions caused by malicious input specifically crafted to exploit a known hash function.
Data corruption caused by accidental hash collisions between legitimate inputs.