Aryan Nayak

One year of consistent leetcoding everyday

This is my one year of consistency, coding every day without any days off. 🏃

I also received a batch for being among the 0.12% consistent coders on leetcode.

How was I consistent?

Here's how I did it:

(1) I almost made it a habit, no rocket science. James Clear talks about this in his book Atomic Habits. We do a few habits every day, without even thinking about it like brushing and tying the shoelaces. These habits are in a state of automaticity where we are so used to them, that we need zero motivation to do them daily. It just takes 21 to 66 days to develop a new habit.

(2) Getting into a habit is hard at first, messy in the middle and gorgeous in the end. (Robin Sharma)

(3) After a certain point, I enjoyed coding every day and it almost felt like something is missing if I did not solve any problem.

(4) The days when you don't want to do anything, but you push yourself to do it anyway, are the days when you subconsciously tell yourself that it is important! A hack you can follow to push yourself is to challenge your ego with a very small task like doing a single problem or simply writing a line of code. (That works, again picked it up from Atomic Habits)

Here are a few mistakes that you can avoid while doing leetcode:

  • Build your ToolBox first: We generally force ourselves to get the solution anyway and once we see the solution, we feel bad about ourselves and all the negative self-talk comes into play. But, most people do not understand that you must know the basics first before solving that particular problem. How can you expect yourself to score good marks in an exam, if you haven't studied any chapters from that subject? Clear your fundamentals/syntax first add them in your ToolBox, then push yourself to solve the problem.
  • Getting to the solution is not everything: You should start valuing your efforts, rather than getting the solution. Problem-solving skills are developed in those 30 minutes of you fighting with the problem to get the solution, leveraging different patterns and tools from your ToolBox, and applying them to get the solution. This is the deliberate practice that makes you better.
  • Code is not everything: Pick up a pen and paper, try to think of all the possible solutions, and focus on building up the solution brick by brick. Start with the smallest example, then a bit bigger, and then think about the edge cases. As they say, think twice code once.
  • Concepts are limited, problems are infinite: There are more than 2000 problems on Leetcode you don't need to solve all of them. However, there are only 20–30 data structures & algorithm concepts that you can master.
  • Read other's code: I always go to the discussion section and skim through better ways to solve the problem even If I was able to do the problem on my own. There are so many better ways and perspectives to do the same problem that you might not know.
  • Always time yourself: Install an extension for timing yourself for every problem, the breakdown would be: easy ~15 minutes, medium ~ 30 minutes, hard ~ 45 minutes. Try to delay the gratification of seeing the solution.
  • Try to act as if you are explaining the problem to someone: It can be difficult to clearly articulate your thoughts and explanations to the interviewer; practice this with each question. Act as if you are explaining your solution to a 5-year-old, this will make you aware of your knowledge gaps. (Feynman Technique)
  • Don't care about your ratings: No matter how many questions you solve in the contest, show up every time. Once you show up, you have completed the hardest part.
  • Up-solve the contest questions again: After the contest try to solve the questions without any time limit, if you don't get it then check other's solutions understand what they have done, read about that particular topic, and solve it back again using the specific knowledge.
In the end, it doesn't matter how smart or dumb or lucky you are, if you are consistent enough you can outwork all the people you think are talented or smarter than you.