Advance

HashMaps Data Structure Questions

DSA
10 questions

Question 1

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?

Question 2

Which collision resolution strategy generally performs better in terms of cache locality?

Question 3

Which of the following statements accurately describes a key difference in the behavior of Python dictionaries and Java HashMaps?

Question 4

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?

Question 5

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?

Question 6

Hopscotch hashing aims to improve the performance of open addressing by:

Question 7

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?

Question 8

In the context of hash tables, what does a high load factor indicate?

Question 9

How does using a cryptographic hash function with a random salt improve the security of a hashmap storing user credentials?

Question 10

In the context of hashmaps, what is a 'universal hash function' primarily designed to protect against?