That's why employers need to spend more time convincing potential candidates that the role they hire for is actually worth the trouble of going through this kind of coding interview test.
In the past I've encountered companies that would just throw a multi-hour coding test at you without even giving you any idea of the role they are hiring for. If it's not worth employer's time to get the candidate interested in a position, the position is not worth applying for.