As software engineers, we dream of landing a job at a big tech company. Of course, we must go through the interview process, and the coding interview is one of them. However some of us only have a minor improvement after solving numerous of question. This article shares how to improve steadily by utilizing spaced reptition and deliberate exercise.
Confucius: Learning without thinking is useless. Thinking without learning is dangerous.
You won't improve no matter how many questions you have solved without thinking about the solution but keep checking the others' solutions.
As software engineers, we dream of landing a job at a big tech company. Of course, we must go through the interview process, and the coding interview is one of them. Therefore, LeetCode has become one of the go-to platforms for learning and practicing data structure and algorithms. Many software engineers realize they only make little progress after solving hundreds or thousands of questions.
We have always been told by those experienced software engineers who are good at problem-solving to practice and solve more questions to get good at it. That’s true, but they forget to share with us, or we never ask how they practice. Usually, one would share the spaced repetition and deliberate exercise.
Two of them are critical factors, but we have to be more specific about using them to grind LeetCode effectively. One of the gurus told me I had been using the wrong method to practice all the while.
Below are three mistakes I had made,
Based on the three mistakes I made, they propose the five steps below,
Solve one question with a specific topic daily
We should solve a question with a specific tag daily, especially the weak topic, until you are comfortable with the type of questions.
Assume that I am weak in the depth-first search algorithm. Therefore I should keep practicing it until getting handy with it.
Prepare a timer to time the time
You can better understand how comfortable you are solving the question with a timer. Give yourself a time of 30 ~ 45 minutes to solve the question.
There are three ways to solve the question when you are stuck by going to the discussion section.
You should only go to the next step if you’re at every 10 minutes. However, the more steps you go, the more unfamiliar you are with the topic.
Below is the sample solution for Two Sum
Read the Data Structure or Algorithms used to solve the question from the list.
Click into the list and read the idea of how to solve the question by using the data structure and algorithms.
Read the implemented code.
When you can solve multiple easy questions within 30 ~ 45 minutes, you can increase the difficulty to medium.
Review the question and solution by the end of the day/next day
Constantly reviewing and understanding the solution helps improve your logical thinking, and you might also discover some new and exciting solutions yet practical and effective.
Doing this also helps you summarize and recognize the regularity or patterns.
Below are some of the points you can ask yourself while reviewing,
bas your variable name. You are not doing competitive programming but writing the code for your interviewer to understand.
Understand your strength and weakness
You might gain self-awareness about your strengths and weaknesses after reviewing the question and solution.
Please write it down and check back once in a while.
Remember to review your strength because keep checking your weaknesses will demotivate you.
Example: You managed to solve the question within 20 minutes. Write down what you have done, like the thought process, what have you done to unstuck and etc.
Read the review periodically
It is essential to check back your review on the following day, weekly, biweekly or monthly basis.