Deadlocks, livelocks and starvation
A deadlock is two threads each holding a lock the other one needs, so both wait forever. A livelock is threads that keep retrying without getting anywhere, and starvation is one thread that keeps losing its turn. The interviewer usually gives you two opposite operations, watches them deadlock, and asks you to fix it.
The knife and the chopping board
Two cooks share a kitchen with one knife and one chopping board, and every job needs both. Ana picks up the knife and reaches for the board. Ben has just picked up the board and is reaching for the knife. Neither will put down what they hold until they have the other thing, so dinner never comes.
The kitchen's rule that ends this is short: always pick up the knife first. Whoever holds the knife can then always get the board, because nobody ever holds the board while waiting for the knife.
Now suppose the cooks try politeness instead. Each puts down what they hold when the other tool is taken, waits a moment and tries again. If they wait exactly as long as each other, they repeat the same dance all evening. Then there is the youngest cook, who steps back whenever anyone else wants the tools and never gets a turn.