A colleague recently told me that he enjoyed doing “programming interview problems” and that they’re a fun way to keep your coding skills sharp. I decided to try things out for a month and see how I liked them.
The little logic problems are a fun way to practice coding and problem solving skills.
To get started I first used a platform called “Daily Coding Problem” but quickly switched to “Leet Code”.
My biggest gripe with “Daily Coding Problem” was that it would clutter my inbox. I felt compelled to do the problem every day and felt guilty on days when I didn’t have the time. It was weirdly discouraging, but I imagine this would vary person-to-person.
I quite enjoy “Leet Code”. The free tier service is good enough for my needs and I like the idea of just logging on to the site when I have time and picking one of the hundreds of challenges they have available. This approach worked for me as I found there were some days I didn’t have time for a daily challenge. You’re also not bound to that one problem, if you don’t like the problem you thought sounded interesting you can pivot to another. Obviously you can’t do this during an interview but we’re just practicing.
Documenting my progress
I’ve documented the problems, solutions, and tests for the challenges I was given in my coding-problem github repo. The answers are written in Python.
Thoughts on the problems
A lot of these problems feel the same. They’re either about:
- Manipulating characters of a string (i.e.: determine if a string is a palindrome)
- Manipulating arrays (i.e.: merge these two arrays and sort them)
- Requiring a bit of funky math to solve (i.e.: convert a binary number to an int)
- Something out there like traversing a binary search tree
Once you do a few of each the novelty of doing multiple variations of these many times over wears off pretty quickly. I’ll see how long I stick to my one-challenge-per-week goal but I’m not optimistic.