Send the candidate off with a broken unit test to fix, own tools, comfortable environment like home, 1 hour time box.
I like to do something horrible based on timezones, or phone number validation, with a Wikipedia article that is the spec.
At the end, ask the candidate about their solution, and do a code review session.
The (best) seniors just use a library.
The good candidates roll their own, but can explain the tradeoffs.
The juniors get the test to pass and stop.
> something horrible based on timezones, or phone number validation
What? Do you have something against zip codes and email addresses?
I like to ask something to do with strings - English sentences. I tell them it's intractable in the time we have and that I really want to see how they whitebox-test the code they write, so take ~10m timebox to write the code, then write some tests - at least one test that finds a bug.
The (best) seniors just use a library. The good candidates roll their own, but can explain the tradeoffs. The juniors get the test to pass and stop.