My attitude is that take-home tests should be given to candidates if they cannot share work they've already done.
This creates a win-win incentive because it would become standard in our industry to have a portfolio of GitHub contributions, a stack overflow profile, etc. At least those artefacts are helpful to a wider community as well as showing your abilities.
Couple this with an open ended technical conversation with the engineer, progressively drilling down on items they know about to see the depth of their skillset, you will understand the key skills they can present for the job opportunity.
I have never in my life done something you can find on Github and I doubt I ever will. I have worked on plenty of stuff that I can share generic 'war stories' on, stuff you might even have 'used' without knowing but that isn't actually anything I could really "show" to you. Other than said war stories, like 'did you ever ride a train and it was late? Yeah I worked on xyz backend thing which ultimately is involved in getting that info to that info screen at the train station'.
And no I don't think you can put any incentives anywhere to get that code onto a Github repo, nevermind a public one.
This creates a win-win incentive because it would become standard in our industry to have a portfolio of GitHub contributions, a stack overflow profile, etc. At least those artefacts are helpful to a wider community as well as showing your abilities.
Couple this with an open ended technical conversation with the engineer, progressively drilling down on items they know about to see the depth of their skillset, you will understand the key skills they can present for the job opportunity.