Today, I guarantee you that candidates will
eventually take that risk to cheat in the online assessment stage in the hopes of getting an offer from the company and will likely turn into a
bad hire.
Not hiring them is better than a bad hire.
If it were me, I would not use Hackerrank, Leetcode, or other online puzzles sites. Instead it would be just a conversation in to just show me your open source contributions in large repositories or you building projects (open / closed) that others are using.
That is it.
For contributions, they must be under public code review or you doing the review and for open source projects they shouldn't be hello world / test projects but useful to others which are used as dependencies in other larger open-source projects.
A basic easy conversation that rids of 95% of cheaters and frauds and those who cannot code.