Question 1
What is a key-value pair data structure primarily used for?
1
Associating a unique key with a corresponding value
2
Storing sorted data efficiently
3
Implementing graph algorithms
4
Reducing memory consumption
Question 2
Which of the following data structures is NOT a key-value pair-based data structure?
1
HashMap
2
TreeMap
3
Priority Queue
4
Redis
Question 3
Which key-value pair data structure maintains keys in a sorted order?
1
LinkedHashMap
2
HashTable
3
TreeMap
4
HashMap
Question 4
What is "load factor" in a hash table?
1
The maximum number of elements allowed in a hash table
2
The ratio of occupied slots to the total capacity
3
The time taken to insert an element
4
The percentage of non-empty slots in a hash table
Question 5
In a concurrent environment, which key-value store offers built-in thread safety?
1
HashMap
2
ConcurrentHashMap
3
TreeMap
4
HashTable
Question 6
Which key-value store is commonly used in distributed caching?
1
LinkedList
2
TreeMap
3
HashTable
4
Redis
Question 7
In a HashMap, if two keys have the same hash code, how is the collision handled?
1
The new key-value pair replaces the old one
2
The key-value pair is ignored
3
The new key-value pair is stored in the same bucket using chaining or tree structure
4
The HashMap throws an exception
Question 8
What is the primary advantage of using a key-value store over a relational database?
1
Better support for complex joins
2
Requires less storage space
3
Fast lookup and retrieval of data
4
Stronger ACID compliance
Question 9
Which key-value store is often used for real-time analytics and time-series data?
1
Redis
2
LevelDB
3
RocksDB
4
HashTable
Question 10
What is the primary disadvantage of key-value stores compared to relational databases?
1
Lack of complex query capabilities
2
Requires more memory
3
Does not support distributed systems
4
Poor performance for key lookups
Question 11
Which of the following is NOT an example of a key-value database?
1
Cassandra
2
Memcached
3
PostgreSQL
4
DynamoDB
Question 12
Which of the following is the most suitable key-value database for large-scale event logging and analytics?
1
SQLite
2
HashTable
3
Apache Cassandra
4
MongoDB