I recently subscribed to the Daily Coding Problems email newsletter. As they put it:
Get exceptionally good at coding interviews by solving one problem every day.
Now, I am not planning on interviewing any time soon, however, I feel that algorithms and mathematical-type programming is something I need to improve on. As a result, I thought it would be a good idea to take up the challenge!
From the get go, I am a little behind. I have already received 7 emails, but I only go to doing the first one today. So much for New Year's Resolutions!
I liken these coding problems to fitness drills in sport - while a sportsman or woman may be fit and be good at the sport they play without specific fitness drills of training. Chances are very good that their overall game will be much improved by doing specific drills and training that focus on individual elements of their game. This is my development version of the daily jog or push-ups. Short, limited exercises that don't take too much time, but are focused and when done repeatedly will lead to health and strength improvements!
As part of this exercise, I am also including tests.
For the tests, I am using Jest. Namely because Jest is easy to setup and get going and I have familiarity with Jest from using it with Node.js and Nest.js.
It is only in the past few years of my career that I have started to break out of the negative thought pattern that I wasn't a real developer. Part of that pattern remains and is somewhat rooted in the fact that while I write code that works. I am never quite sure if the code I write is good. Good is subjective in a sense, but from my perspective I mean good in the sense that:
For example, doing this first problem some thoughts that go through my head are:
In any event, much of what I have written above might be wrong and as a result, I have some homework to do! Namely to find out:
The repo is here.