Question
What is a 'Hash Table' and how does it handle 'collisions'?
Solution
Hash function converts a key (e.g., AccountNumber) to an array index. Average O(1) for insert, delete, search and it degrades to O(n) for worst case with many collisions. Collision resolution is done by Chaining in which each bucket holds a linked list of all keys mapping to that index (simple, handles high load factors). Open Addressing means on collision, probe for the next available slot (linear probing, quadratic probing, double hashing). Load factor (n/m) determines performance. Hash tables power Python dictionaries, Java HashMaps, database join operations, and caching systems.
- In a data warehouse, which of the following best describes the concept of "data granularity"?
- What is the space complexity of storing an adjacency matrix for a graph with V vertices and E edges?
- Internet of Things (IoT) In an IoT ecosystem, which protocol is most efficient for constrained devices communicating over lossy networks?
- Which data structure uses FIFO (First In, First Out)?
- Deletion in Red-Black Trees maintains balance using:
- What is the time complexity of searching for an element in a sorted array using binary search?
- What is the primary purpose of a B+ Tree in a database management system?
- Which I/O scheduling algorithm is most suitable for minimizing seek time in hard drives?
- Which of the following best describes the function of the Control Unit (CU) in the CPU?
- Which of the following scenarios violates Boyce-Codd Normal Form (BCNF) in a relational schema?