Trivia questions and puzzle problems tell you who prepared for interviews. They say little about how someone works on a real codebase.
Ask about work they have done
“Tell me about a system you built and what you would change.” A good answer includes trade-offs, mistakes and what they learned. A vague answer is a signal too.
Look at real output
Code samples, pull requests, open source work or a project they can walk through. Not everyone has public work, so offer an alternative.
Keep any task small and relevant
Two hours on something close to the job. Ask them to explain their choices in a follow-up call. Long unpaid tasks lose good candidates.
Check collaboration
How do they take review feedback? How do they explain a problem to someone less technical? Ask for a concrete story.
Write it down
Use the same questions for each candidate and note answers straight afterwards. It makes comparisons fair and speeds up the decision.