I think it's impossible to nail these interviews without minimal prep. It's very specific, and every candidates are well-prepared, many of them have done 500+ leetcode questions before interviewing.
Regarding the US universities, I'm not sure but I wonder if some students can somehow compensate a lack of academic mathematics excellence with extracurricular activities, or being rich or from a minority. Maybe companies want to filter those out?
As for creativity, leetcode interview questions is all about preparation. There's little creativity.
It’s definitely possible. Mostly you’d want to learn your algorithms well in college and continue to exercise them in your work. The rest of the interview is a lot about how you present yourself, which is mostly along the lines of “work out the problems out loud and ask questions”.
Also, FWIW, I’ve had a decent amount of opportunities for creativity on Leetcode-style questions. When permitted I often pick the language that I feel would make the solution simpler or easier to understand. When doing things like linked list or graph traversal you’re often asked to define the datastructure you’ll be using, which is a good chance to use different types of polymorphism or algebraic datatypes that can make your task easier. Even if you’re just churning out for loops, a lot of them can be replaced with functional methods or selective application of interesting utilities such as array rotation.
Not my experience. When I interviewed at Google for a senior position, I mostly had difficult questions with little interaction with the interviewer.
Before my preparation, I could solve all the questions within let say a couple of hours and I knew very well all the algorithms. But that's not what's expected to pass. You're competing with people who have been working very hard on this style of interviews and you need to be among the best.
You're expected to find the answer to a couple of questions within a 40 min. That includes finding the solution, writing the code (not pseudo-code), testing your solution and discuss complexity.
Thinking 15min + sketching some pseudo code is not enough, or maybe for a particularly hard problem.
My take on this is that the problem is misaligned expectations. I failed Google's algorithmic interview round twice under the assumption that when the interviewer asked me a question, the point was to see if I could come up with the answer.
But that isn't true. The interview questions are chosen with the expectation that candidates cannot come up with the answer themselves. Instead, the point is for the candidate to cold-read the answer from the interviewer.
When a test -- or a computer -- asks you how to do something, it won't care or even realize that you spent ten minutes thinking about the problem before starting to write a solution down. But an interviewer will fail you for doing that.
That insight was enough to pass the interview round. And it also suggests that a course in "how to pass an interview" should boost CalTech grads' passing rates to nearly 100%, because all they need is to be informed of the "proper" technique.
But that's not all that's going on here! CalTech is pretty selective as far as US schools go (6% acceptance rate). Slightly more than MIT, slightly less than Stanford. SAT score stats all in the same 1500+ range.
But they're offering this course, and that makes me think that no, the worst student from these schools in the US, at least cannot nail any algorithm interview with minimal prep!
And that makes sense, from a US perspective! Getting into CalTech or Stanford or MIT is about doing well at high school/early-college level material in high school, and about extracurricular activities, with a dash of being able to afford it and being told it's something you should try for. Most of that high school curriculum - even most college-level CS material - isn't super applicable to a software engineering job. It's heavier on memorization (we have google for that!) and it's heavier on theory than on creative application of things.
I might argue that any test or course where the answers to the exams come straight out of the textbook isn't worth as much as it used to be, since we've got Google and SO and all the books too!
That's a big part of why a lot of these whiteboard interviews aren't simply "write out Dijkstra's algorithm" (boring, textbook!) but are about seeing if you can figure out how to use apply CS in a situation where the way the problem maps to the algorithm isn't immediately obvious.
Creative work has a long history of not aligning well with traditional US university admissions criteria and evaluations.