As a recent graduate, I know many people who used the "free work for a short term" method to get in the door for a new job. It isn't going to work at very large companies, but at startups and agencies, absolutely. "Illegal" sure, but a smart manager wouldn't turn down a chance to get a great look at a potential employee