Why in the world would anyone be interested in doing this? Companies are competing for talent, not the other way around.
What the parent of your comment describes sounds a lot like a specific kind of contract-to-hire, which if it's done well can be really effective. I get to show off that I can actually develop software well, a company gets to judge me on more than just an hour (or maybe a day) of questioning.
Unfortunately it can be pretty exploitative if done wrong. It's easy for it to become an unending period of low-paid work where you're just hoping that one day it'll turn into a real job.