I hate stupid leetcode based interviews. It's like "gotcha journalism " just to have a justification for a subjective rejection
It's like when as couple of weeks ago some random recruiter was interviewing me and asked "what's your weak point as a manager" ... I was sincere and if course the reason I was rejected is because they are looking for someone who doesn't have THAT exact weakness. GOTCHA!!
Rejecting candidates based on their response to those types of questions is completely counter-productive. You'll just end up with a bunch of employees who are either liars, or very good at delegating blame. You want employees who take ownership of their work and assigned tasks.
As for programming tasks/questions in interviews. I think that it's important to test applicants' practical knowledge of sorting and other enumerable operations as it's a common task that's often done wrong, often with significant performance impacts. However, requiring a candidate to re-implement a common sorting algorithm for an array of numbers does nothing but stroke the interviewer's ego. The last time I actually had to write a sorting algorithm from scratch was in a 200-level computer science paper.
An actually sane interview question/task would be to ask the candidate to sort an array by an unconventional comparison, using a language's standard sorting functionality.
For example: sorting an array of coordinates by their absolute distance from (0, 0), or sorting an array of RGB colours by intensity. They're problems that a programmer would realistically encounter in a real-life application, and test that the candidate actually understands how to manipulate non-trivial enumerable/comparable data.
Asking candidates to implement quicksort selects for applicants who have a case of Not-Invented-Here Syndrome. You don't want to hire programmers who implement their own sorting algorithms from scratch, there's a >90% chances they'll implement it worse than the language's standard implementation, while wasting a bunch of time that could be spent solving actual business problems, and creating technical debt to boot.