Sitting with a hard problem
Olympiad training doesn’t really teach you tricks. It teaches you to stay in the room with a problem long after it stops being comfortable — to keep turning it over when the obvious moves are gone.
That habit turns out to be most of debugging.
A bug you can’t explain is just a proof you haven’t finished. The temptation is to change things until the symptom disappears; the discipline is to keep asking why until the mechanism is obvious. Same move as a geometry problem: don’t guess the construction, understand why it has to be that one.
Two things I try to hold onto:
- State what you actually know, separately from what you assume. Half of hard problems dissolve once those two piles are apart.
- Find the smallest case that still fails. In maths it’s a base case; in code it’s a minimal repro. Either way, the small version tells the truth.
None of this is fast. But “fast” was never the goal — right was, and right tends to be fast on the second pass.