If arrays are the backbone of data structures, hash maps and sets are the tools you'll reach for the most in interviews. The moment you hear "have I seen this before?" or "how many times does this appear?" — you're reaching for one of these. This post breaks down what hash maps and sets are, how they work under the hood, and why they show up in almost every coding interview.
What is a hash map?
A hash map stores key-value pairs. You give it a key, it gives you back the associated value. Instantly.