Programming is about Problem-Solving
ChiEn Leow
Posted on March 21, 2021
After all, programming is more about problem-solving than actually writing code. I would like to share my take-away from this podcast episode by Developer Tea - Interview w/ Nicole Archambault (Part 1).
8 Steps in Problem Solving
1. Read and Understand The Problem
Understand the problem thoroughly by reading the question out loud at least 3 times. In a live coding interview session, I usually clarify the question with the interviewer to make sure we are on the same page.
2. Rephrase The Problem
Rephrasing the problem by putting it into different teams allows us to really understand it. By doing so also allows us to see the problem from different perspectives.
3. Identify Input, Output and Variables
Ask yourself, what input and output are we expecting? What given variables do we have? Does it expect a different data structure as an output?
4. Break Down The Problem
As an example, go grocery shopping: make a shopping list, go to the store, pick out items, pay for them, carry them into your car, etc. You are going to break down the problem into bite-sized pieces that you can do something with.
5. Pseudocode
Pseudocode your solution in plain English. What is pseudocoding you may ask? Here's an example of how to write pseudocode.
6. "Translate" Your Code
"Translate" your code from plain English to a programming language.
7. Debug Your Code
8. Optimize Your Code
You can post your solution and get perspectives from others.
I like to put it this way, we programmers are like magical translators, what sets us apart from non-coders is that we basically problem solve by translating English to computing languages all day.
Posted on March 21, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 30, 2024