Point to the buried key by flipping one stone
Asked at Jane Street, SIG
Two teammates share a plan in advance. A warden lays out 16 flat stones in a row, numbered 0 to 15, each lying painted-side up or down in a pattern the warden chooses. The warden then buries a key under exactly one stone and secretly shows the location to teammate A.
Teammate A may flip exactly one stone (turn its painted side up or down) and must then leave. Teammate B, who saw neither the key nor the warden's setup discussion, walks in, looks only at the 16 stones, and must name the stone hiding the key.
Find a scheme that always works, whatever the starting pattern and wherever the key is.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.