Coding interviews require a different set of skillset compared to practical software engineering. Interviews mainly test on algorithms and data structures, which most software developers do not come across in their day-day work.
I’ve always wanted to work on my interviewing skillsets so that when the opportunity to interview arises, I’ll be ready for the interview. My efforts to incorporate Leetcode as a daily route was sporadic over the last few years.
There will be times when I get really motivated and managed to leetcode almost daily but eventually when life comes knocking back, the routine started to wane off.
Since December last year, I had another surge of motivation to leetcode. But this time round, I was ready, prepared and equipped with the several habit tips from the book “Atomic Habits” by James Clear.
The 4 tips are:
Make it obvious
The 2 most common habit cues are time and location. Habit stacking is a strategy you can use to pair a new habit with a current habit.
The habit stacking formula: After [CURRENT HABIT], I will [NEW HABIT].
I stacked the habit of leetcode with my gym routine.
Before going to the gym, I will head to the coffeeshop to leetcode.
Make it attractive
Habits are a dopamine-driven feedback loop. When dopamine rises, so does our motivation to act. It is the anticipation of a reward not the fulfilment of it that gets us to take action.
Temptation bundling is one way to make your habits more attractive. The strategy is to pair an action you want to do with an action you need to do.
Habit Stacking + temptation bundling formula: Before [CURRENT HABIT — something that I desire ], I will [HABIT I NEED]
This is rather similar to mentioned in rule 1.
Before going to the gym (something that I want), I will head to the coffeeshop to leetcode.
Make it easy
It is human nature to follow the Law of Least Effort, we will naturally gravitate toward the option that requires the least amount of work.
For a habit, in the beginning, when you’re motivated and excited, you can muster the strength to get started. But after a few days, such a massive effort feels exhausting. The less energy a habit requires, the more likely it is to occur.
Start with the questions that are easiest and have solutions.
I sort questions in my queue in this order.
- Solutions provided
- Acceptance rate (the % of submissions that are accepted.)
Make it satisfying
The human brain evolved to prioritise immediate rewards over delayed rewards. To get a habit to stick you need to feel immediately successful — even if it’s in a small way.
Habit tracking: simple way to measure whether you did a habit. Habit tracking makes act of performing your act attractive. Tracking can become its own form of reward. It is satisfying to cross an item off your to-do list.
I kept a to-do list and a habit tracker on my calendar of my progress on Leetcode and other habits that I’m trying to build.
My results so far are that
- completed close to 200 questions on Leetcode.
- participated in one Leetcode live contest
- learnt numerous data structures such as
- adjacency list
- monotonic stack / queue
- heap / priority queue
- learnt numerous algorithms
- Disjoint Set Union
- DFS / BFS iterative and recursive
- Deterministic State Automaton
- Topological Sort
Thank you for reading till this far, I hope that you managed to learn something from this article and incorporate it in your life.
Full Article: Yew Wee @ Medium
Roblox paid out $741 million to game creators in 2023
Last year, about a hundred Roblox games brought in more than $1 million, with nine games bringing in at least...
What Windows 12 Mobile could be
It's been nearly a decade since Windows phones effectively ceased to exist, but fans still hold on to the memory...
Vortex – High-performance particle effects for SwiftUI
Vortex is a powerful, high-performance particle system library for SwiftUI, allowing you to create beautiful effects such as fire, rain,...
Mobile App Development Trends – 21.02
Core Data migrations, Refining Compose API, State-of-the-art Open Models and more!
Apple Maps Bottom Sheet
In this video, I’m going to show how to place Modal Sheet over the Tab Bar just like Apple Maps...
Groq speeds up language models
Overall, LPUs could improve AI application deployment and provide an alternative to Nvidia's A100 and H100 chips, which are widely...