Problem-solving
11 April 2024
1. The time I was blocked on a simple problem:
- what was the problem?
- what problem-solving techniques did you use?
- how did you feel throughout the process?
- what did you learn?
As I can remember, the problems that I got blocked on were so easy but I got blocked for at least an hour or I need to come back the next day to see if I can fix it or not. The first time when I didn't check the pass requirement carefully an logged out the value that didn't ask in the test; the second time was I didn't type the words careful enough then left a 's' in a word.
I tried console.log and the duck method and I can log the value I want to but just couldn't pass the test. It was just because I didn't check carefully to match the needed test results.
Man, that was just frustrating. It was like you spent hours on this and thinkng it's something really big or hard to solve but it turned out it was all because you were not being careful enough.
For sure to check the test requirement and the spelling carefully. If I don't understand what the test is asking, I will read it until I understand it. And for spelling, I think I better do copy and paste to reduce the chance that I type it wrong.
2. elegantly solved a problem.
- what was the problem?
- what problem-solving techniques did you use?
- how did you feel throughout the process?
- what did you learn?
I couldn't figure out why my for loop wouldn't loop through each items in an array.
Then I used rubber duck method to try to see if the problem exists in how I structured my code. After making sure everything was right I started to use console.log to see which part of the code went wrong. If it was the array itself or the syntax I passed in the for loop or I didn't console.log the right thing then I found I didn't put .length after array which will definitely cause the failure of my loop.
I quite enjoy the process. It's how I learn solving a problem myself and I think it is more of a practical session that helps me to put the problem-solving method into practice.
What I have learned is there are different ways to find what goes wrong in your code. The more you practice it, the faster I will find where the problem lies.
3. Reflect on how confident you feel using each of these problem-solving techniques/processes:
- Pseudocode: 3/5.
- Trying something 4/5.
- Rubber ducky method 4/5.
- Reading error messages 2/5.
- Console.logging 4.5/5.
- Googling 4/5.
- Asking your peers for help/ Asking coaches for help 3/5
- Improving your process with reflection: 4/5.
This would be the confident level I have for useing pseudocode. I feel like it is more suitable to build a bit larger code that what I can code currently. But indeed, it is a powerful tool to help me and guide me through when I am trying to make a clear line of what I am going to do next.
This method is great because when I was trying to test the function in kata with my DevTools, I always try hard coding to see if I can get the result from it. If not, it is also esay for me to use console.log to see which part went wrong.
I use it in a way that I don't need any physical product or stuff to say it to. I just say it to myself and explain everyting to myself to see if my code structure makes sense.
I use this method but sometimes I don't really understand the error messages either from the console or from the test terminal. I google the error message if I really want to know why I couldn't get my results but the chances are I may not even understand the google result.
This is the method that I use quite often. It's easy and the results are quite striaight forward. I can get the result from the part that I want to so I will know which part goes wrong directly.
I use google quit often too. To find the way to anwer my questions. But it normally takes me some time to filter the results I got online. And I need to find the one that I can understand easily.
I think these two can be reflected on together. I actually prefer to solve the problem myself first because I think I can solve it by myself. After trying everything I can online, console.log it and googling it and still a no, I will ask in the Discord see anyone available to help me out.
I normally write the mistake I made on my notebook and write it down when I do my end of the day reflection.
4. Reflect on a time you were reluctant to ask for help. Consider what made you reluctant to do so. What might you try differently next time?
There are actually a lot of time that I was reluctant to ask for help because that was the time I still think I can fix the problem by myself. But it will come to the time that I am at the edge after at least an hour and I still have no clue. That is the time that I reach out to ask. I think it is not like I don't want to ask or anything, it is just my stubbornness asks me to solve it by myself until it got exhausted for not fixing it.