An employer usually asks a candidate to do a small project at home ("homework") as a part of applying for a job.
Last time I applied for a job (as a web developer), there were aproximately 10 applicants who were all given different tasks. Despite the fact that there was only one vacancy, the company used the work of all of the candidates in one of its projects.
Actually, it is quite plausible for a company to create these "vacancies" just to make people work for free - I estimate, that aproximately 2 weeks of programmer's work was saved with all of the job applications that company had on one vacancy.
Is this a common practice and how can you protect yourself from working for free in the future?
Have you seen this during your career?