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
Mobile App Development Best Practices – 21.09
iOS Closures vs. Delegates in Swift iOS How to use the new inspector SwiftUI view modifier How to create an...
2023 App Threat Report
In 2022 alone, the number of mobile app downloads surpassed a staggering 200 billion, emphasizing the pervasive presence of these...
ElectricSQL – Local-first sync layer for web and mobile apps
Local-first sync layer for web and mobile apps. Build reactive, realtime, local-first apps directly on Postgres. What is ElectricSQL? ElectricSQL...
GitHub Copilot Chat opened to individual developers
Like similar chatbots, Copilot Chat sits in the sidebar of the IDE, and developers can use it to have lengthy...
ComposeCard – A beautifully designed payment view library
ComposeCards is a beautifully designed payment view library for Credit and Debit Cards. Made using Jetpack Compose 🎉. It allows...
Mobile App Development Best Practices – 20.09
Airship has released another study of mobile users aka shoppers. A lot of interesting things about habits and tasks in...