Big-O & Your Two Workhorses

The two structures you'll reach for 90% of the time

A list (dynamic array) holds items in order and lets you append cheaply. A dict (hash map) maps keys to values and looks them up in roughly constant time. Master these two and most backend problems fall over.

Big-O is just how the work grows as the input grows. O(1) means constant โ€” the same cost no matter the size. O(n) means it scales linearly with the number of items. O(n) is fine at 100 items and a disaster at 10 million.