I read the other answers, and I 100% agree with all of them. It seems like everyone who answers this question feels the same way about preparing for Google interviews using leetcode.
My perspective is that practicing in leetcode will greatly improve your chances of acing a Google interview, but it will not ensure that you can pass the interview. In fact, even if you have answered all the questions, or think that you have answered all the questions, you might still stand a good chance of failing the Google interview.
There are some common mistakes that I see people make when attempting coding interviews in general. If you heed my advice carefully, it will greatly improve your chances of acing Google interviews, or in general, any other coding interview.
- Being unable to communicate and explain a clear strategy for solving the problem. Most candidates will attempt a rough, hand-wavy approach of solving problems before writing the code. This is not enough, especially for Google. You kind of know that when someone is hand-waving through the verbal explanation, they will probably do the same when writing the code, and the code will likely have some loopholes or bugs.
- Coding too slow. Note that your code can be 100% correct, but if you are too slow, you will not pass the interview.
- Not using the optimum algorithm. If you waste too much memory in your solution, or your code is not reasonably efficient (e.g. O(N^2) solution when you could do O(N log N)), you will likely not pass the interview.
- Writing messy code. Coding style matters. If you get a 100% correct algorithm, and it is optimally efficient, but you use bad variable names or write weird code, then points will be deducted and you run the risk of failing the interview. I am not talking about missing semi-colons here, those are usually not deal breakers. But for example, if the question is about binary tree traversal, and you name your method “traverse”, that is a big no-no. You should name it something like “findLeafNodes” or “isBalanced”. Using bad variable names does not instil confidence in the minds of the interviewers.
- Confusing the interviewer with bad communication skills. This one is super common. I am not talking about having a heavy accent, or lacking mastery of the English language (or any other language for that matter). If you find yourself talking to other people, and they have no idea what you are talking about and have to clarify with you for understanding, then that is a red flag in interviews. No one wants to work with coworkers whom they find that they misunderstand all the time. Communication skills can certainly be learnt, and should be learnt.
- Having a presumptuous attitude (ego, negativity, pride, selfish etc.). Don’t be a jerk, because no one likes to work with jerks. One tell-tale sign is that if you think you are a rockstar coder, and that attitude shows up in some way during the interview, then that is an immediate failure.
I’m certainly not trying to give a guide on how to pass Google interviews here, but note that besides leetcoding, you also should spend at least a bit of time on doing mock interviews with real interviewers.
In short, passing the Google interview is indeed not easy, but certainly not impossible. Hope this helps!