Lesson 4.2.6.1

4.2.6.1 Hash tables, hashing and collisions Quiz: AQA Computer Science, Unit 2

20 questions

In partnership with Revision Ninja

Lesson 4.2.6.1, Hash tables, hashing and collisions: 20 multiple choice questions for the AQA Computer Science (7517), Unit 2: Fundamentals of data structures, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. Which data structure creates a direct mapping between key values and stored values?

    • Binary tree
    • Hash table
    • Queue
    • Priority queue
  2. What converts a key into a specific storage index in a hash table?

    • Index pointer
    • Hash function
    • Key mapper
    • Search algorithm
  3. What occurs when a hash function generates the same index for two different keys?

    • Underflow
    • Deadlock
    • Collision
    • Overflow
  4. Which process finds an alternative slot in a hash table when a collision occurs?

    • Sorting
    • Indexing
    • Truncating
    • Rehashing
  5. A hash function is key MOD 7 and the table has 7 slots (0 to 6). Where is the key 23 stored?

    • Slot 3
    • Slot 5
    • Slot 2
    • Slot 0
  6. Using the hash function key MOD 7, to which slot index does the key 17 hash?

    • 4
    • 3
    • 2
    • 1
  7. A hash table of 10 slots uses key MOD 10. Which slot does the key 47 use?

    • 47
    • 0
    • 4
    • 7
  8. A hash table has 11 slots and uses key MOD 11. Which key below would hash to slot 0?

    • 13
    • 9
    • 23
    • 22
  9. What is the primary purpose of spreading keys evenly across a hash table?

    • Eliminate pointers
    • Sort key values
    • Reduce memory size
    • Minimise collisions
  10. Which hash table operation executes in O(1) average time when collisions are minimal?

    • Sorting keys
    • Finding minimum
    • Key lookup
    • Full traversal
  11. Which collision resolution method checks consecutive slots sequentially until an empty slot is found?

    • Binary search
    • Chaining traversal
    • Depth-first search
    • Linear probing
  12. Using linear probing with step 1, where is a key hashing to occupied slot 4 placed?

    • Slot 0
    • Slot 6
    • Slot 3
    • Slot 5
  13. Which property ensures a hash function distributes keys uniformly across all available slots?

    • Sequential ordering
    • Inverted indexing
    • Uniform distribution
    • Reversible mapping
  14. Which data structure is most commonly used to implement an abstract dictionary data type?

    • Queue
    • Stack
    • Hash table
    • Linked list
  15. Which slot do keys 5, 13, and 21 all hash to using the calculation key MOD 8?

    • Slot 0
    • Slot 7
    • Slot 3
    • Slot 5
  16. What component maps a key to a valid storage index within a hash table?

    • Hash function
    • Index vector
    • Search tree
    • Pointer array
  17. Which index do keys 12 and 27 both compute using the hashing algorithm key MOD 5?

    • Index 2
    • Index 5
    • Index 0
    • Index 1
  18. What is a key disadvantage of a hash table compared with a sorted array?

    • Higher time complexity
    • Greater memory usage
    • Unordered data
    • Slower searching
  19. What is the best way to resolve frequent collisions in a nearly full hash table?

    • Truncate all keys
    • Clear the table
    • Resize and rehash
    • Sort the table
  20. Which mathematical operation is most commonly used in simple hashing algorithms?

    • Square root
    • Logarithm
    • Modulo
    • Factorial

All AQA Computer Science quizzes