Work-sample tests, in my experience, are universally "do this crap and then maybe we'll talk to you." It's nothing you'll get serious feedback on, it's nothing you can open-source, it's garbage code and wasted time that benefits the company unilaterally.
But the alternative--it's not the whiteboard, it's the meeting people. Right now, I consult, but I do take interviews for "permanent positions". But we all know they aren't actually permanent positions. The last thirty years of corporatism have made this loud and clear: we are all expendable tools. and I go into them with that in mind: a W-2 doesn't mean I'm anything other than working for a client under a tax-advantageous status. Interviews are business development; I am effectively offering my exclusive services on retainer to a single company. So meeting people to discuss the gig (whether or not the whiteboard comes into play, the only interview I've been on in the last two years where I was both interested in the company and wrote code on the board was Google) benefits me, too: maybe it's not a fit, but maybe I meet somebody I'll remember as "hey, I'd like to work with them again." Or "hey, I don't want to work here, but I know somebody who will, so I can do them a solid and they can help me in the future."
So, yeah, it is work. It's just business development, which is a different, and valuable, kind of work. And it applies to everybody, not just consultants; it's the game we're all playing even if one doesn't realize they're playing it.
OK, I agree it's also really important to spend a few hours meeting people, and I would never accept a job where I couldn't do that first. But I am personally thrilled to be able to spend two hours demonstrating that I am a really good programmer in all of the ways that a different kind of test doesn't pick up. That seems to benefit me a lot, and it also speaks well of the future coworkers I will have if I work at the company in question. Google's process (for instance) makes me nervous about this.
(Disclaimer: I strongly prefer to quit my current job before looking for new jobs. If that weren't the case, I'm sure I would be more sensitive to anything that takes time, but I think I would still feel this way.)
You're OK with spending two hours doing something before you get anything out of it? 'Cause I'll readily admit that there are probably companies out there that do such a test afterwards, but I've never seen one personally. Instead it's the gate to protect their precious engineers' time. Yours, though? Yours doesn't matter, and that rustles my jimmies real fierce.
Look at the opportunity costs: what if you could spend the time they want you to give them, for free, building something not only personally creditable but maybe even generally useful on Github? If you're good enough to show off, as you suggest, then your time is valuable enough that it should be respected. (A work-sample test that's a useful, valuable problem and can be open-sourced? I'd be down for that. But that would be haaaaard.)
I just spent the past month looking around for interesting new work after quitting my last position. Two of the ten or so smaller companies I've interviewed with so far had work-sample-ish tests as part of the hiring process: Keybase and AltspaceVR. Both of them had already made my short list of potentially ideal companies to work at, and I had ample time to ask them questions and chat before doing the work sample project. (At Altspace I went and had lunch with the co-founder and the director of engineering, and also tried out their VR software.) I felt no compunction at all spending 2-3 hours doing a interview project after that. Afterward, it was clear that both companies read my work and judged me based on it.
If companies were cold emailing me on LinkedIn asking me to do their two hour project, I would not do it, but neither would I bother going to interview with them. Given that I'm already cherry-picking which companies I care about, I don't mind investing some time to make them care about me.
EDIT: I agree that it would be nicer to spend time doing something really useful. I hope that if I handed them a FOSS thingy that was representative of my ability, that these same companies would respect that in lieu of their work sample -- although standardization is valuable for evaluation purposes, so I can understand if they wouldn't. (I just did the projects they suggested because I thought they sounded fun.)
Yeah, I've never had that experience! I'm sure I could be flexible about that--after I've been sold on the gig in the first place. But I feel like that's maybe an inversion of what it's usually used for: to weed out the shitty applicants. Looking at my Github and my blog (both linked on any documentation a client or prospective employer would see) should be enough for that to not waste either of our time, but at many places The Process Shall Never Be Modified.
(Right now, I'm helping out a few days a week over at a fairly large Boston startup, and while they have a general work-sample test that they roll out, I never took it. I probably wouldn't have followed up past the initial phone call if a monkey dance was necessary to get in the door.)
But the alternative--it's not the whiteboard, it's the meeting people. Right now, I consult, but I do take interviews for "permanent positions". But we all know they aren't actually permanent positions. The last thirty years of corporatism have made this loud and clear: we are all expendable tools. and I go into them with that in mind: a W-2 doesn't mean I'm anything other than working for a client under a tax-advantageous status. Interviews are business development; I am effectively offering my exclusive services on retainer to a single company. So meeting people to discuss the gig (whether or not the whiteboard comes into play, the only interview I've been on in the last two years where I was both interested in the company and wrote code on the board was Google) benefits me, too: maybe it's not a fit, but maybe I meet somebody I'll remember as "hey, I'd like to work with them again." Or "hey, I don't want to work here, but I know somebody who will, so I can do them a solid and they can help me in the future."
So, yeah, it is work. It's just business development, which is a different, and valuable, kind of work. And it applies to everybody, not just consultants; it's the game we're all playing even if one doesn't realize they're playing it.