306. What problems is a hash table a poor fit for?
EasySymbol tables & hashing
Technical
Show model answer
Hash tables scatter keys, so they cannot answer order-based questions efficiently: sorted iteration, minimum/maximum, predecessor/successor, range queries ("all keys between 10 and 20") and rank queries all need an O(n) scan. Balanced BSTs, skip lists or B-trees answer these in O(log n), and tries handle prefix queries.
Hashing is also weak when worst-case latency must be bounded (resizes and collisions cause spikes), when keys are mutable, when memory overhead per entry matters, or for approximate/nearest-neighbour matching, where locality-sensitive hashing or spatial trees are needed.