I hate that this has become so entrenched, and I hate that my previous jobs don't allow me to use samples from their codebase in my portfolio. I hate feeling like my github or bitbucket are sparse and this is somehow a sin. Just give me a takehome project and I will show you how I program, it is really that simple! Don't force me to waste my precious time making little toys in my spare time to potentially amuse someo…
I once applied for a job where that was the entry exam: they gave you the specs for a program about a month in advance of your interviews and you were expected to bring in the solution you wrote. The task was intentionally extremely difficult (they specifically warned you about that).
Although I didn't get the job, I really did appreciate that approach to skills testing. I thought it was brilliant.