Words in plain English0/59 done

Words in plain English

Interview words that sound harder than they are. Each one with a picture you can keep in your head.

PointerJust a number saying "which position I'm looking at", like a finger on a line of text. "Two pointers" means two fingers, for example one at the start and one at the end, walking toward each other. In a linked list, a pointer is "who is next in line", like each person holding the shoulder of the person in front.
O(1)Same speed no matter how big. Looking up a room number on the hotel board: 50 rooms or 50,000, one look.
O(n)Look at everything once. Reading every name on a list of 1,000 takes 1,000 looks.
O(log n)Throw away half each step, like the "higher or lower" number guessing game. 1,000 items take about 10 steps, 1 million about 20, 1 billion about 30.
O(n log n)Good sorting. 1 million items, about 20 million steps: fast enough.
O(n²)Compare everything with everything. 1,000 people all shaking hands is about 1 million handshakes. 1 million people: far too slow.
Hash mapA lookup board: give a name, get the value in one step. In JavaScript: new Map().
SetA guest list: only answers "is this name on it?". In JavaScript: new Set().
StackA pile of plates: you add and take from the top only.
QueueA bank line: join at the back, served from the front.
RecursionA function that asks a smaller copy of itself. "How deep is this family tree?" equals 1 plus "how deep is my deepest child's tree?".
Sliding windowA frame you slide along a list: grow it on the right, shrink it on the left, never go back.
In placeRearrange inside the same list, without making a copy.
Memo / dynamic programmingWrite each answer in a notebook the first time, so you never work it out twice.
LatencyHow long one request takes. Throughput: how many requests per second.
CacheA whiteboard of recent answers kept close, so you don't ask the slow place again.
ReplicaA copy of the data on another machine, so one machine dying loses nothing.
ShardSplitting data across machines, like A to M in one cabinet and N to Z in another.
IdempotentDoing it twice has the same result as doing it once. Pressing a lift button again doesn't call two lifts.
Queue (in system design)A to-do list between services: one side drops jobs in, workers take them out when free.
Log (in system design)Not a debug log: an append-only list of events in order, like a bank statement. Kafka is one.
Race conditionTwo people grab the last seat at the same moment, and both think they got it.

How to read any page in this book