This is such a frustrating new trend! I’ve talked to people who have had as many as 8 interviews for a job, only to get turned down. I suspect that there’s not much to be done about that, but if you get invited for an interview, I do encourage you ask how many rounds there will be early in the process. If they can’t answer you, you may not want to go down that particular rabbit hole.
The assignments are potentially a much bigger deal. I’m fine with assignments that are theoretical—the sort of tasks that check whether or not you can do the work. Those assignments are usually fairly short, and it’s pretty obvious that they just want to make sure you know what you’re doing.
What I have an issue with is those assignments that can be used for the company’s benefit. If you haven’t had some sort of nondisclosure agreement with the employer, you might find yourself doing lots of work, not getting the offer, and then finding your work being used by the employer! Talk about nefarious!
If you get a work assignment as part of your interview process, be sure you ask questions about the scope of the work and how it will be used. You can bring up non-disclosure agreements, as well, to ensure that the potential employer is not using you as free labor.
What should you do if they are trying to use you as free labor? I take that as a very good indicator of what they think of you, and if they value a potential employee so little, I suspect it won’t be a workplace that lets you feel valued. In that case, I recommend you say something like, “Thank you for your interest but my time and effort are valuable and I am no longer interested in this position.” You will probably feel alarmed by saying it, but it’s better than doing a project for free and without credit!
And it’s better than working for an employer that doesn’t value your time or contributions.