Assume a map stores "pear" → 7 and a caller asks for get("pear"). The exact operations depend on the language and implementation, but a hash table must turn the key into a candidate location and still verify that the stored key is equal.
1. Hash the key
The implementation calls the key's hash function and may mix the result so its bits distribute well across the table. The hash is not the key and collisions are possible: distinct keys can produce the same hash.
2. Select a candidate bucket
The table converts the hash to a bucket index using its capacity and representation. Some tables use a mask when capacity is a power of two; others use a remainder or another scheme. Resizing changes the mapping and may require reinserting entries.
3. Resolve collisions
With chaining, the bucket can contain multiple entries. With open addressing, the implementation probes additional slots according to a policy. In either case, the lookup may inspect more than one candidate. A deleted entry in an open-addressed table can require a tombstone so later keys remain discoverable.
4. Check equality, then return
The map compares candidate keys using the language's equality rules. Matching hash alone is insufficient. On equality it returns the associated value; after exhausting valid candidates it reports absence. Expected constant-time behavior depends on a reasonable hash distribution and controlled load factor, not a guarantee that every lookup performs one memory access.