Problem Solving: JavaScript Kata's


My approach to Problem Solving during Sprint-4

I’m a big fan of riddles, and whenever someone tells me a riddle, I rack my brain to find the answer. Riddles are challenges that can only be solved when you interpret them correctly. Often, the answer is more straightforward than we realise, but we don’t encourage our brains to think creatively and laterally. That is how I would sum up my experience so far with JavaScript. It’s one big riddle which seems more complicated than it is.

It took me almost two days to solve the Gradebook Kata. The biggest problem was my unfamiliarity with loops and arrays. I knew the principles behind them but nothing beyond that. The more solutions I tried the more I became frustrated when they didn’t work. I eventually had to reach out for help. Doing so encouraged me to break down the problem more, which helped me interpret the challenge better. Eventually, I looked back to the previous sprint and realised that the solution was relatively straightforward, and I was unnecessarily overcomplicating it by trying so many different solutions.

Once Gradebook was complete, I took the rest of the day off to reflect. The next day I approached each kata with a better idea of interpreting the question, tried the simple solutions first, and determined if they were working as intended. If they were, but the test didn’t pass, I knew I was on the right track, and it was just missing a few more things. The more I did this, the more confident I became; progressively, each challenge became easier.

The latter half of the challenges felt easier with this process, the simple solutions worked, and I knew why. Some things did take longer; the deBee kata was very subtly challenging, specifically the “regardless of capitalisation” section. Everything else was passing, so I looked back to the previous lines I wrote and noticed the toUpperCase syntax, so I implemented the opposite toLowerCase, which, low and behold, was the solution after all. I felt like a coding god when I completed the WhereAreYou kata, which took me less than 15 minutes to complete, which I think was a little easier than the rest, but I still felt like a God spitting out syntax.

The Katas were a great challenge to practice what we had learned. The most valuable experience for me was practising pseudocode to break down the problem, mentally or explaining it to my doggo. Asking for help from fellow students or my sister (who knows JavaScript) came in clutch when I was stuck, and hearing their interpretation of the challenge helped me piece the syntax together.

To cap this blog post off, I leave you with a simple riddle. “I begin with ‘e’ and only contain one letter. What am I?”. Bragging rights to anyone who figures it out, no cash prize, unfortunately, student budget.