Back to problems

Design a Dictionary for Heterogeneous Key and Value Types

Object-Oriented Programming · Microsoft · Medium

Design an in-memory associative container that supports keys and values with heterogeneous runtime types and variable-length storage. Describe the full contract for hashing keys, testing key equality, handling collisions, and managing ownership of stored key and value memory. Because arbitrary objects are not automatically safe to use as keys, identify exactly which types your dictionary supports and explain how callers can supply hash and equality routines for custom types.…

Checking your access…