Have you heard of first principle?
It is a term from Physics, and it has been used by Elon Musk for inventing his products.
This means we have to start thinking with the most fundermental element, this actually works really well when I was studying.
In this article, I would like to share my learning methodology and how it leads me to mutiple job offers.
So what is the problem we are encountering at first?
We would like to learn how to perform well in job interviews and impress the interviewers, what element should be included?
In this article, we are going to focus on 2. By the first principle methodology, we have to break down it into the most fundermental elements. Therefore, when I was learning, I first try to list out what will make me a better coder.
Finally I have break down into this few elements
This is important to learn the basic before doing leetcode problems
Instead of practing on the problem directly, I started off by revising each data structures and common algorithm.
For example:
Instead of memorising the complexity, I try to learn how it work my reading a lot of books and youtube video to prove it by myself. This can help me to strengthen the memory and this will help you to figure out why it's better to use some of the data structures in some cases.
For example, stack is a last in first out data structure so we can get the element from the top easily with O(1) but it sucks when accessing the bottom element.
After learning about the theory part, it is also recommended to learn about some common the language behaviour.
e.g. why we need to use string builder instead of string concat, what is the sorting algorithm being used by the language, etc
Then we can start coding!
The way I started coding is visite the Explore session, there are a few topics that are much important to start with:
This is because these questions are relatively standard simple, you can finish the problems and memorise a pattern you are confortable with. After this, you should be able to use the same framework to work on BFS/DFS or Binary Search problems
After that, my recommendation is to work on the following sessions:
These session are relatively easy and you can skip the problems you cannot solve at first.
Then, we can start learning in the following sequence:
The reason why I put recursion and linkedlist before trees is that recursion is very important for many tree problems. The linkedlist session can also train yourself to be familiar with the use of pointers. After the two sessions, you should be able to complete the tree sessions pretty easily.
After the basic
After learning the basics, you should be able to solve 30% of the medium problem pretty quickly. You can start exploring some harder topics such as graph and dynamic programming. In this case, using the Problem tag is useful for clustering different problems.
You should also improve your coding style by reading the discussion session and look for a better way to present your code. If you are not sure whether the coding style is good, go and check out PEP8, there will be a full documentation on how to have a good coding style.
How to make further improvement?
After the training, you should be pretty good in solving medium level problem. However, in some strange problems, you will still find it hard to solve. Thats the reason why you should test yourself on different topics by using "random question selections". At the begining, you will find that half of the problems take time to solve, but after practicing more, you will find out that you are more and more familiar with the problems.
Consistency is a key to success
It is preferrable to do 1 question a day for 100 days rather than working on 100 questions on the same day. The rationale is that your brain takes time to convert what you have learnt to a long term memory. Therefore, it is important to stay consistent. For this case, leetcode daily challenge is a very useful tool for keeping your habbit. Started from April 2020, I worked for at least 1 questions per day, now I feel more confident then one year ago!

I hope you guys find my sharing useful, please leave any questions if you want to know more!