Problem Solving
Te Whitiora i roto i ngā Tikanga Rongoā Raru
Navigating through my problem-solving techniques
27 September 2025A Simple Problem That Was So Confusing…
I was messing around with JavaScript and got totally stuck trying
to figure out the difference between these two array methods -
.forEach()
and .map(). I went
googling stuff, asked AI to show me some examples, and just played
around with both on some basic arrays to see what would happen.
I felt pretty silly being stuck on something that seemed so basic
but when it finally clicked that
.forEach() just does
stuff to your existing array (might change it, might not), while
.map() actually creates a
whole new array through this callback function thing.
The whole experience taught me that you've really got to master those fundamental concepts before diving into more advanced techniques.
Elegantly Solved a Problem
One of my assignments asked me to write a function called
flipflop
that returns "FlipFlop" if a number is divisible by 15, "Flip" if
by 3, "Flop" if by 5, or the number itself otherwise.
At first, this looked like an ordinary conditional problem, but I remembered from coding practice that when using divisibility checks with multiple conditions, order matters. For example, 15 is divisible by both 3 and 5 and all three, so the most specific case (divisible by 15) needs to come first.
So I started by outlining my logic using pseudocode:
IF number is divisible by 15, return "FlipFlop"
ELSE IF number is divisible by 3, return "Flip"
ELSE IF number is divisible by 5, return "Flop"
ELSE return the original number
Translating that to code was straightforward:
export function flipflop(numberParameter) {
if (numberParameter % 15 === 0) {
return 'FlipFlop'
} else if (numberParameter % 3 === 0) {
return 'Flip'
} else if (numberParameter % 5 === 0) {
return 'Flop'
}
return numberParameter
}
I used pseudocode to map out my solution, put my conditions in the right order, and tested it to make sure it worked. I felt good about taking a step-by-step approach. The main takeaway? Planning your logic clearly at the start leads to cleaner code and fewer problems down the line.
Ranking My Coding Problem-Solving Strategies
| Technique | Confidence Level | Explanation |
|---|---|---|
| Pseudocode | High | It helps me plan code step-by-step and avoid confusion. |
| Trying something | Medium | Sometimes I'm hesitant, but willing to experiment and learn from mistakes. |
| Rubber ducky method | Medium | Explaining problems out loud helps, but I don't always remember to use it. |
| Reading error messages | Medium | Becoming better at using errors to debug, not always clear at first, AI does explains at most. |
| Console.logging | High | Its essential for me for tracing bugs and understanding program flow. |
| Googling | High | My go-to for quick answers and documentation when I'm stuck. |
| Asking your peers for help | Low | I usually try solo first, working to get more comfortable seeking help. |
| Asking coaches for help | Low | I should ask for guidance more frequently to improve learning speed and task efficiency. |
| Improving your process with reflection | Medium | Useful for reviewing what worked and what didn't, but needs regular practice. |
Overcoming Reluctance
I often feel reluctant to ask for help when I'm stuck on a coding problem. Usually, I worry that my question might be too basic or that I should be able to solve it myself. I end up spending a lot of time trying to find the answer alone, which sometimes makes me feel frustrated or slows down my progress.
To improve, I want to remind myself that asking for help is normal and shows a willingness to learn. I plan to practise asking questions earlier instead of waiting until I feel stuck.