Other than that the question is stupid, and most companies have a policy that forbids such questions. Same goes for "piano tuners in Manhattan" and "why are manholes round".
1. To see what your thought process would be in figuring out the answer. 2. To judge your reaction to such a nonsensical question. 3. To show off (either the interviewer is showing off or the company is showing off).
That said, they have some value depending on the position your being interviewed for.
I imagine that's a bit like asking how can you completely clean malware off a computer without reformatting. The answer is roughly the same: In the general case it's impossible, because once arbitrary code has been executed on your machine, nothing can be trusted.