EDIT: A kiwi once asked me "what do you do for a biscuit?" for which I required the translation: "and what might your area of expertise be?"
PS: I would ask: "What kind of biscuits? Do they have low glycemic and high satiety indexes?"
The best answer I heard is that only domain experts have a chance to recognize each other. Other than that you are left with secondary signals like other people paying them for their expertise.
> An expert has a track record and has had to face the consequences of their work. Failing is part of what makes an expert: any expert should have stories about how things went wrong.
This might sound so obvious as to be a non-answer, but I think it's a good point. There are many "experts" who acquired degrees in, wrote papers on, and now teach others about their area of focus, but have at no point in that process had to, say, stake their employment on being correct about that area.
For example, professors of literature have all written thousands of pages of text about good novels, but there's little evidence that they can actually make good novels.
At least in software craftsmanship, experts are best identified working with others. It appears to be an irreducible process that cannot be pantomimed with trivia-based interviews or formulaic problems. Acting in an arrogant fashion or looking smart has zero correlation with performance, but it can fool some people some of the time who lack subject matter expertise.