Suppose I have n boxes, the first k of which are filled with gold; the remaining n-k boxes are empty. You have two magic wands. If you tap on a full box, the wand opens the box; if you tap on an empty box, the wand explodes. Find the value of k using only the two wands.
Credits to @john78 for contributing this interesting question.