# When a Loop Inside a Loop Is Too Slow: Hash Tables at Work

Turn the gym's slow year-end reports into one pass: count each member's visits, find the first member to come back, and stop asking a slow server the same question twice. Then choose a list, a set or a dictionary for a job, and say why.

![Cheat sheet: When a Loop Inside a Loop Is Too Slow: Hash Tables at Work](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/4a2199f7c4614966a20b4fdf5c29aceb.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: Cache (software-development), Cache Hit, Cache Miss, data structures, Frequency Count
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/ds-hash-tables-at-work-cheat-sheet
