Home Core Tech

Problem Solving

Disscuss about a time you were blocked on a simple problem:

During this week, I had to write a function to capitalize all the first letters of the words in a sentence. The first solution I wrote was't getting to the result I expected. So I kept trying to change my code, based on instructions in the challenge and material I researched online. After a little bit of research and some changes in the code, it was giving me the result expected when I console.loged it (printed the answer the computer was seeing in the screen so that I could see it too), but still failing the test of the function ( the test is the code that our teachers write so that we can check that we completed the challenge).

After trying a few different thing to make it pass the test, I decided to ask for help on Discord. One facilitator answered and pointed that part of my code was printing out with console.log, but wasn't linking with the function, when it was called, thanks to his answer, I could go back and fix the code (using one more function), and a few minutes later it passed the test. How wonderful!

To try and find a solution for my problem, I used some of the resources we explored this week, for problem-solving. Usually, the first thing I do to try and solve a coding problem is to read it through and try to break it down in steps to follow (Pseudocode). Then I try something following the steps I marked before, or I Google to find some method that will help me.

While I try something that I have learned before or read during my research, I use console.log to check how the code is working and if it returns the result I expect. In case it doesn't, if I receive an error message i read it to see what kind of error is it finding, to guide the changes I'll make. It isn't always easy to understand the error messages for me, but they helped me think of what directions to follow next

Although I feel I have spent too much time in the process of solving each challenge, I enjoyed the process and I learned in each step of the way. I not only learned about coding, but also about time management, problem-solving strategies that can be used in any challenge I face in the future, and the importance of asking for help when we can't work things out on our own.

Discuss about a time when you elegantly solved a problem

Also during this week, one of the challenges was to write a function that would give me a certain item in a list (array), that was hidden. At first I thought it would be a very complicated problem to solve. The function should work even if the item changed to another position in the list.

I broke the problem in smaller steps to follow and did a quick research in the method I was required to use for that exercise. I read through the material on MDN and found a line that seemed to me that could work for that problem. I went back to my file and wrote my function, using the steps I had written (sketched) on my notepad and the info I found online. It worked beautifully in the first time I tested it and I was filled with joy.

Reflect on how confident you feel using each of these problem-solving techniques/processes:

Home