How is a Dictionary (hash map) built?
The general scheme
key → hash(into:) → 64-bit hash → bucket index. A bucket stores the key and the value; when different keys produce the same index (a collision) you need a resolution strategy. Lookup: compute the hash, go to the bucket, compare keys with ==.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep