During one time I was using a recruiter to get a position, he had me interview with a company that used an online coding test as a first-level filter. I didn't know what they were going to ask, but I asked if he had any idea - all he would tell me was that it was something like good-ole "fizzbuzz".
So I studied a bunch of stuff. Anything and everything but fizzbuzz (not that I needed to study that). Then I decided to go for the test - which was timed - and...
...fizzbuzz.
I'm sitting there a bit dumbfounded - seriously? So I coded it up from memory; I could have easily pulled a solution down off the net, but I figured "what the hell - let's go old-school" on it. Also - if I just cut-n-pasted something in, and they saw "it took the candidate one minute to code it" - they might suspect something, then google search the plagiarized code. No good.
So - I coded it up; it was in PHP, but the job was supposed to be for javascript/node (???) - so I wrote it as a class, then I spent the remainder of the time optimizing it - making it the fastest FizzBuzz solver I could, complete with tests and demonstration code. I took up the entire available time, and submitted that. I made sure to add proper PHPdoc comments to everything.
...and I got an "in-person" interview as a result. At the end of that was an another "live coding" session - this one using javascript for a "single page" app. They left me to it, and I got everything coded up inside of 15 minutes or so (there was a paper document laying out what the challenges were in the example code). They were watching my progress via screen sharing.
Apparently I completed the task quicker than other applicants. I later learned that some applicants just sat there unable to do anything (not even google around for help!), or they would take convoluted paths to implementing the changes; not necessarily wrong answers, just not efficient ones - and would be sitting there doing this for a couple of hours (at which point the interview would be brought to a close).
At the end, I got the offer.
Ultimately - those are the kind of challenges I like - give me a real coding assignment, something close to what you are really working on. In this case, it was also in two different languages - so I could also help to "bridge gaps" between a PHP team and a javascript team as needed (added value for the employer).
I really dislike whiteboard coding - completely unrealistic, and while I gather why it is a widely used tool, I think there are better ways to gauge a developer's competence for the position - and actual coding challenges to solve problems seems like one of the best ways to do so (though I also understand that it is very time consuming - so an up-front online timed challenge might be a good pre-filter for on-site or further interviewing).