Why? Two reasons:
- If the coding sample is in a language (or large framework) that I will learn on the job, I don't think I will have any success. Something that's a 20-minute job for one person could be a 5 hour "learning exercise" for me.
- If the sample is something like a bugfix or enhancement where I have to go through the whole process, the time commitment is just too large. I have to come up to speed with new frameworks, conventions, idioms, layouts, designs, which is time consuming. Then, the review process itself may be time consuming, or slow to get feedback if company engineers don't see my work as a priority.
I prefer coding samples that require very little ramp-up and process. Let me use a language that I'm familiar with. (If I will learn a language on the job, let's agree on a language that I and the evaluating engineer are comfortable with.) The coding exercise should be fun, without assuming knowledge of extensive frameworks or processes.
In general, good coding assignments look like a high school coding competition, or a topcoder question.
[Edit]: What I've really liked, in the past, was a company that did a very basic coding sample instead of a phone screening. It took me about 90 minutes to write, and was rather fun.
What I had to do was write a small program that navigated a maze. Navigation occurred by loading parts of the maze through a web service. Other than that, there were no requirements for language, framework, process, ect.
In short, I didn't have to onboard myself, or have extensive domain knowledge, in order to do the exercise.
I find coding exercises that require extensive domain knowledge are only useful when screening subject experts. IE, we're hiring someone who has extensive knowledge in language X with framework Y and design patterns Z. Sometimes teams need domain experts, other times they need experienced engineers who learn the tools on the job.
[Edit 2] The statement "When hiring senior engineers, the company doesn’t choose the candidate, the candidate chooses the company." is very important when choosing a skillset. Part of what sells a job to me is the opportunity to work on a new language, framework, ect. This is why coding assignments that require extensive domain knowledge are, ultimately, a turn-off.