It never happened–since they knew in advance, they had time to whip up something cool if there wasn’t anything else. It didn’t have to be massive. I just wanted to see some clean non-trivial code and a clear understanding of how it worked. Fizzbuzz wouldn’t have impressed. :)
I always left it open-ended and that seemed to work. Part of the interview was seeing what they’d come up with. I’m pretty sure people always brought things they’d already written.