What is a Hash Table?

Updated Apr 28, 2026

Short answer

A data structure that maps keys to values using a hash function to compute an index into an array of buckets.

Deep explanation

Hash tables are fundamental for fast lookups. A data structure that maps keys to values using a hash function to compute an index into an array of buckets. By using a mathematical transformation, they bypass linear scanning required by arrays.

Real-world example

A dictionary or phonebook lookup.

Common mistakes

  • Assuming hash tables are always O(1) without considering collision frequency.

Follow-up questions

  • What happens if the table is too full?

More Hash Tables interview questions

View all →