Most recently I asked a candidate to work a few hours on a real project for a fair hourly rate. I think this is much better for all involved. As a bonus, you get to see how they perform on a real project, rather than a contrived puzzle and they get to see what sort of work they might be doing if hired.
Paying people for a few hours of work is difficult: if we pay them as an employee then we have to do employee paperwork and deal with the payroll company. If we pay them as a contractor then they have to sign a lot of contractor paperwork, including a confidentiality and intellectual property assignment agreement. It's the kind of thing I wouldn't sign without my lawyer's advice. It just seems like too much trouble.
Instead, we'll either work on a throwaway toy project or an open-source project. Both of those are working well so far, and people seem happy to actually ship some open-source code at the end of the interview.
Bravo.
I can't stand when companies do this. Whether it's design or development, it's basically spec work. It's one thing if it's a general question, but if they ask you to do work related to their service, why not just pay them for a few hours or a few days?
I have so little time to myself that I can't spend hours solving each little puzzle a HR department comes up with...
When I hire, I do a phone screen before asking the candidates to complete the code exercise. If it isn't going to be a fit from either of our perspectives, then they didn't spend time doing it.
I have a major open source project under my belt, but I've never had an interviewer simply ask me about my code. Instead, they ask me to sort an array.
In regards to discussing existing code, I'd be more than happy to do so, but my experience has been that about one person per stack of resumes has quality existing code available to share.
The biggest plus for me as the hiring manager is that it allows me to be much more confident in taking flyers on people without that picture perfect resume.
That same system was implemented on the company's website later on, which didn't make me feel any better. To top it all off, they never even replied.
B) How do you know they programmed that app with thousands of users even remotely well? Did they store passwords in plaintext? Does it need to be reboot every 5 mins? Is it slow as molasses, but hidden behind load balancing?
Someone could have written awesome sites with 1000s of users and loads of revenue, but it might still have been done like crap, and doesn't belong anywhere on your network.
B) I ask them questions about the implementation.
You can get a feel for whether the candidate can program a simple blog by asking them how they'd do it, you don't have to ask them to spend hours actually doing the nitty-gritty...
"Time I'm willing to dedicate to your interview problems" and "time I'm willing to dedicate to reading and writing on HN" are not freely interchangeable; you can (and presumably do) have radically different expectations of the costs and benefits that make them incomparable.