Problem Solving

A time when I was blocked on a simple problem

This would definitely be the FizzBuzz challenge.

For this challenge, the goal was to create a function that takes in a number and returns 'Fizz' when number is multiple of 3, 'Buzz' when number is multiple of 5 and 'FizzBuzz' when number is multiple of both 3 and 5.

I started out ok with some pseudocode, then I moved on to writing the actual code. I managed to pass the first few tests and was able to somehow get the code to return 'Fizz' and 'Buzz' when the conditions were met. However, I hit a road block with the 'FizzBuzz' condition and couldn't figure out a way to get pass. I read the error messages, I tried rearranged my code in different ways but kept failing, sometimes even failing some of the previous tests that I had already passed. This made me feel quite frustrated and I therefore totally forgot about programmer's best friend - aka 'console.logging' - as well as learner's best friend - aka Google. I did not ask for help either because I saw that a lot of other learners have already moved on way ahead of me which I interpreted as that the problem must be solvable on our own. It was only until I became too annoyed at myself for being stuck for so long without being able to resolve the problem that I turned to Discord and looked at some of the questions asked previously by other learners to get some hints. In the end, I still managed to complete the challenge within the time box suggestion.

Having said that, I felt that I could have done better if I treated myself better for the effort and progress that I had made until the point where I looked up for hints. Althought I do not regret what happend (and I could not change it anyway), I have learned my lesson. I think that part of this was due to the fact that I jumped straight into the FizzBuzz kata after completing the previous katas and other learning materials fairly easily, without giving myself a long enough break/reflection time to recharge. This has led to me forgetting about other problem solving techniques that I could have tried before reaching out.

A time when I elegantly solved a problem

I don't think that I have solved a problem elegantly (if any) but any instances where I solved a problem on my own without reading Discord for hints or reaching out for help is a win in my book. One such instance might be the Manipulating JavaScript Objects Kata.

Similar to above, it was pretty smooth sailing for me at the start. However, I then bumped into an obstacle where I was required to add a ben property which should be an object with a key name and the value "Ben" to a property children of the main object terah. Sounds confusing enough? Yea because I felt the same when I first attempted this challenge. So if I were to describe their relationship it would be like this:

So firstly what I did was try a few different combinations that I could think of based on previous learning and knowledge to no avail, not to mention some even made me failed previous tests (which I had already passed at this point).

At this moment, I did not see any use for pseudocode or rubber ducky, asking peers or coaches for help when I was still well within my time box would mean giving up too easily, reading error messages and trying something as per above did not work and I'd forgotten about good friend console.logging for some reason. So I turned to the omniscient and omnipotent (well almost) thing known to man - Google. After a quick search and a few visits to a couple of sites, I had a light bulb moment and immediately understood the syntax error in my code. So I went back and made some edits based on my understanding of how it should be written and hit the run button to test and VOILA!. The rest of the challenge was once again smooth sailing and I finished the challenge with around half the time box suggestion remaining.

Overall I felt proud for being able to solve the problem with ease however I learned that I should keep calm when facing challenges. I probably could have got unstuck on my own if I had remembered console.logging. I feel that it's easy to lose track of the many problem solving techniques you could try in the heat of the moment so it's better to keep calm and keep a list of all the techniques readily available so that I can go through them one by one in the order of those which I can implement on my own to those which I need to ask for help.

My Confidence Level

Technique Confidence Level Comments
Pseudocode 2.5/5 I feel only half confident here. This is mainly due to the fact that a lot of the time when I look at a challenge, I don't know where to begin or can't really map out the steps to achieve the goal that the challenge asked of me. Even with writing down the pseudocode, I still feel that the pseudocode doesn't represent something that I can easily translate to code and therefore figure out the right methods or functions etc. to use
Trying something 3.5/5 I feel decently confident with this. I am good at trying and breaking things #laugh-emoji
Rubber ducky method 2/5 I haven't practiced this too much. I think that the challenge I faced with trying this method is similar to pseudocode. I think that once I'm able to get better at the pseudocode technique, I should be able to talk and "walk" myself through the steps in my code which hopefully will lead to more light bulb moments
Reading error messages 4/5 I feel really confident with this technique. I think this is in part thanks to the fact that so far the challenges all have very clear error messages designed.
Console.logging 3.5/5 I feel above average confident with this. I would like to give credits to Jason Aricheta from Kotare 2022 cohort, he has told me that that console.logging is widely used for bug fixxing in JavaScript and since then, I have been incorporating this into my code a lot more. This has helped tremendously, allowing me to follow the steps in my code and give me a clearer picture into the results of my code at any given stage.
Googling 4/5 Definitely something I feel pretty confident at. Although sometimes reading the answers from googling and apply it to my code requires a lot more than just
Asking your peers for help 3.5/5 I am definitely not afraid to raise my hands and ask around when needed although the frequency is not as much hence this score.
Asking coaches for help 2/5 This score is probably not a true reflection of my confidence level but rather due to the fact that I have not had many situations where I have to ask for the help of coaches. Usually one or many of the other methods have helped me overcome all the challenges so far.
Improving your process with reflection 3/5 I am not sure how to rate myself on this. Although I notice that on a few occasions when I revisited and reviewed my code, I was able to improve it a bit. So maybe that is what this technique means?!!