The only way to really see how someone thinks is to just hire them, work with them for a while, and fire them if they can't do the job. You can either pay the costs of hiring and firing (like on-boarding, benefits, administration, severance) and get useful signal about their performance, or you can spend the same money by throwing it away on useless shit like HackerRank-style trivia tests. Per applicant, the HackerRank thing seems cheaper, but you typically have to spam it across many more applicants, endure losses due to great candidates who won't agree to your bullshit hiring process, and still end up firing people sometimes when they pass the trivia but (surprise) it didn't mean they would be good at the job. So overall, it's just as expensive.
You spend the money either way, might as well get useful signal out of it.