“Do you code during your leisure time?” the consultant asked my team while coaching us towards the Agile journey over 6 years ago.

“Coding is fun,” the consultant continued, “I code a lot during the weekend.”

As a software developer, coding is our daily job. We’re already tired of facing the computer and the console. If we code during our leisure time, it looks like we can’t rest and leave the “daily job” on the table.

Nowadays, with the aid of ChatGPT, whenever I need a script to automate the boring stuff, I usually throw my request to it, refining the prompt and slightly altering its output. The script is then ready to use. Over the years, I didn’t spend too much time writing code outside the office hours, except when I designed the coaching session for the company’s Agile training.

I’m now looking for career advancement. My friends and (ex-)colleagues suggested I use LeetCode. LeetCode is an online programming learning platform. Many big tech companies use whiteboard interviews to challenge the interviewees on data structure and algorithms. Some tech companies even use the problems from LeetCode for interviews. LeetCode markets to the programmers who want to succeed in these interviews.

Working on enterprise back-end applications for traditional industry, the workflow of most of our applications can be generalised into a few steps:

  1. Receive either an asynchronous event or synchronous HTTP request from the request.
  2. Find the record from the database.
  3. Do some stuff.
  4. Update the record and save it into the database.
  5. Respond to the requester or send an event to the next handler.

We spend the most time working on business knowledge, clean code, microservice architecture design, dependency management and handling various human factors. It almost doesn’t involve data structure and algorithms – most coding tasks are straightforward. We never talk about the time and space complexity. After 10 years, I lost almost all the techniques in this area. LeetCode fills this gap.

When I started the first LeetCode problem, I realised how insufficiently I have trained over the past years. I sat there feeling like my brain was empty for several minutes, even if the problem was labelled as easy. I felt powerless without a proper IDE using a text editor. In the end, I wrote a brute-force solution. I checked the hints and the discussion in the platform and finally wrote a better solution.

The LeetCode problem is very challenging, at least for my current condition. But this rekindled my long-dead passion for solving challenging problems. Instead of treating it as an interview training tool, I want to relearn the data structure and algorithm and enjoy being challenged by difficult problems.

Coding challenges bring surprises and accomplishments. I finally understood what the consultant said 6 years ago, and put it into my habit list.