> I think it can make sense in only one instance: for entry-level positions, if the person is trying to break into the software industry and they don't have a relevant degree.
I'm not even sure I think it's necessary here.
We have a guy working for us who's a former nurse, and was still a nurse when he interviewed with us. He'd started programming on the side as a hobby, and our job ads were pretty explicit that we didn't really care about your background as long as you could program and were a reasonable human being, so he applied.
We still have a very short (20 - 30 minute) pre-screener interview before our main interview (90 - 120 minutes). That pre-screener has three objectives:
1. Figure out if the candidate is really interested in the job. We're not expecting people to turn tricks to show their enthusiasm or anything ridiculous like that, but we've had enough candidates that give off a "totally can't be arsed" vibe that we're basically just looking to screen those out.
2. Quick read on what the candidate is like as a human being.
3. Answer the question: can they write any code at all?
For (3) we have a whole raft of simple problems that require the candidate to write half a dozen or so lines of code. We'll generally explain the problem, given them an empty method or function and ask them to fill it in.
One example is write a function to reverse a string: this one's interesting because, in C# as an example, there's a functional solution, and an imperative solution (of course, there are several variations). The functional solution is enough to understand whether they at least grasp the basics of functional programming. The imperative solution will tell you whether they know how to use basic control flow and iteration, understand arrays (a string is really a wrapped array of characters), know about mutability and immutability, etc. Most of our code is OO/imperative, with some use of a more functional style where appropriate, so we generally encourage in the direction of imperative.
All our pre-screener problems are kind of like this: basic numeric or string manipulations, because our systems contain a lot of numeric and string manipulation. Definitely not leetcode: most of these problems don't require any knowledge of data structures more advanced than an array. It is literally: can this person code in any language similar to what we use here at all?
Our former nurse nailed the pre-screener first try - didn't even get caught out by any off by one errors. Whereas I've seen plenty of "senior developers" completely fail at these very basic tasks.
Our full interview involves a more in-depth pair programming exercise. Again, our former nurse nailed it, where plenty of more experienced candidates have made a right hash of it.
We took on our former nurse with both him and us realising that he'd have loads to learn, but four years later he's still with us and doing incredibly well.
This is obviously anecdata, but it does show that you don't necessarily need leetcode to assess someone entirely new to software development.