I have been on both sides in past 10 years: I got hired by completing assignments once and I myself gave assignments to candidates to see if they're capable of understanding the problems they need to deal with if they get the job. It was OK if they can't provide the complete answer. The method they choose is the key to understand their perspective on the solution. Because of that, about 70% of assignments was Q/A and then a related assignment for their coding skills. If candidate can think right on the problem, coding skills are already easy to transfer from an actual employee or even in short time by reading existing code base, etc. In that perspective I think those assignments are OK as long as they make sense for the job description.
But there're another cases much more different which makes me think of need of those assignments. One of them was happened to me.
I'm not sure of the percentage but companies pick candidates via independent head hunters and sometimes company, head hunter and the candidate can be on different places. A head hunter asked me to if I would like to work in a company of extremely popular online multiplayer game (I am not gonna mention company's name) and I sad that was my dream job, of course I would because I thought they're interested in my experience on backend side. After 2 interviews with the head hunter, he suggested me to the company and I got through 3 interviews with their team and second one was with their project leader which went really good.
After 3rd one with some senior team members, they said they have an assignment for me. The assignment sounds like really good. Design a team game, any-kind of team game, from WoW to 2 people Super Mario and decide some rules to apply and apply them randomly to make sense at the end of the game. They said I can use any programming language I want. That was it.
I knew they were using only Java, C++ and some python thanks to the interview with the project leader. I thought their approach was like mine on the assignments. I mean to see the perspective, not the actual complete code because I had only 48 hours. So I decided to apply a game I already have played some (I am not an online gaming person) It's called Heroes of Newerth. In about 18 hours with a few breaks I have applied 2 teams with 5 people in each one, randomly assignable 20 heroes with their all skills (magic, attack, etc.) and 10 average items with their applicable rules. I decided to apply those in python because it was about 5 years ago and I was more comfortable with the language in those days.
After I sent the assignment in a zip file, I started to wait for the answer. They sent an email for another interview after a few days. I was so sure that I got it. I started to plan that I'd start as a remote employee until I get required papers ready to move to another continent, then 16 hours flight and a brand new life! I accept that it was so good to be true :)
Anyway, on the interview with their same senior team members, they started with asking about the graphics by that question: we couldn't run the graphic mode. I said because there isn't. I explained that I created an advanced server/client mechanism with ZeroMQ for an online gaming model which everything goes trough the server and get validated. Client code connects randomly to make sure server waits for 5 people on each sides and all clients have different hero and items randomly. They could keep tracking events by text messages on the screen and I even added a parameter to server to slow down the game if they would see what's happening step by step.
I said I know that authorized server model's not 100% applicable for a real time online game but that's just an assignment and that's what I think of possible to prepare in 48 hours. They just said they were expecting to see graphics. (from a senior backend developer with socket programming and high concurrency experience)
Then I got cocky, never raised my voice but made sure that they got the situation from my perspective. I explained them what they did wrong such as finding a candidate via an over seas head hunter and having no clue what the candidate capable of, having an unclear and not-job-description-related assignment. That attitude was wrong of me when I try to see all of these in their perspective. But on the other hand, I was in their shoes many times and I always read the candidate's resume and assignments was always about the job description and people never had to solve them correctly. Perspective was the key always.
Anyway, I am not sure how many people would read that long text but as you can see that's a really big disappointment for me. But the real reason I put it here to show different perspectives on evaluating assignments.