Tips for Algorithmic Exams
Note
Now all the plugins has supported English. I'm still improving the website...
First, let's address a question: Is it better to practice LeetCode problems directly on the website or in a local IDE?
If you're dealing with a test format like that on Niuke, where you handle input and output yourself, it's definitely best to write in an IDE. However, for LeetCode's format, I personally prefer solving problems directly on the website for two reasons:
1. Convenience
LeetCode has custom data structures like TreeNode
and ListNode
. Locally, you'd have to copy these classes over. Also, you can't run tests in an IDE, so you'd have to paste your code back into the website to run tests, which makes it more efficient to write directly on the website. Algorithms aren't like engineering code; they are usually smaller in scale, so the benefits of IDE auto-completion are negligible.
2. Practicality
In interviews, the algorithm problems you're asked to solve are typically expected to be done directly on a website. It's best to explain your thought process as you write. If you practice without relying on IDE auto-completion, and get used to writing code manually, you'll be faster and more confident during interviews. For example, when I interviewed with Kuaishou, an interviewer asked me to implement the LRU algorithm. I wrote out the double-linked list and hash-linked list implementations on the website without bugs on the first try, which visibly surprised the interviewer.
The reason I could secure multiple offers during the fall recruitment was largely due to exceeding expectations with my manual algorithm writing skills, honed by practicing on the website.
Of course, if you prefer not to work directly on the website, you can use my VSCode or JetBrains plugin for practicing. These plugins are perfectly integrated with my website content.
Next, I will introduce some practical "tricks" and debugging techniques to comprehensively increase your chances of passing coding tests.