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
In the context of amortized analysis of hash table operations, what does the term "amortized" refer to?
The worst-case time complexity of an operation.
The time complexity of an operation when the hash table is full.
The average time complexity of an operation over a sequence of operations.
The best-case time complexity of an operation.
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.
Hash collisions could allow attackers to bypass authentication.
Hashmaps are inherently less secure than other data structures for storing passwords.
An attacker gaining access to the hashmap could retrieve the plaintext passwords.
What is the primary advantage of using a universal hash function?
It makes the hash table resistant to attacks that exploit patterns in the hash function.
It provides better performance than any single, fixed hash function.
It ensures constant-time performance for all operations.
It eliminates the possibility of collisions entirely.
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 makes it significantly harder for attackers to perform rainbow table attacks.
It eliminates the possibility of hash collisions.
It prevents unauthorized users from accessing the hashmap's keys.
What is the primary reason for using a prime number as the size of a hash table in many implementations?
To increase the speed of hash function computation.
To minimize the memory usage of the hash table.
To make the implementation of the hash table simpler.
To ensure an even distribution of keys across the hash table, reducing 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.
Attempts to guess the keys used in the hashmap by analyzing the distribution of hashed values.
Denial-of-service attacks caused by hash flooding.
Data corruption caused by accidental hash collisions between legitimate inputs.
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?
Array + Queue
Binary Search Tree + Heap
Hashmap + Doubly Linked List
Hashmap + Stack
Python dictionaries use open addressing for collision resolution. Which of the following techniques helps mitigate the performance degradation caused by clustering in open addressing?
Linear Probing with a prime step size
Using a cryptographic hash function
Robin Hood Hashing
Separate Chaining
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.
Implementing a random salt value in the hash function to make collisions unpredictable.
Switching to a different data structure like a tree-based map that offers consistent performance.