Algorithm

People are talking and studying how to code online through MOOCs a lot these days. You question yourself why they are doing that. And have you ever wondered what is the relation between algorithm and personal development? The below content will show you some personal development tips in relationship with algorithm in programming.

Question:

Giving a first array and another array. Check if the second array is included in the first array and return the position of the matching number in first array. If not, return -1. Example:

Same question. After 2 years of self-learning in real world, confronting ups and downs and achieve the [im]possible. The way I approach to this question is totally different. Not the same anymore. I also suddenly realize that the way we solve algorithm also can be applied into our daily life, self-development and business world. This is why there is an urge and the stress of importance to learn coding for both young kids and entrepreneurs on many medium. These are what I have learned from solving this algorithm. (I am not saying my algorithm is good, there is always a better one)

1. “Setting vision and goals”

Before thinking of the solution for algorithm, programmers always have to understand the clear goal of the requirement, input and output. In real world, Steven Covey advises to “start with an end in mind” from 7 Habits of Highly Successful People. It’s setting the goal that you have to start with first hand before taking any action. Do not wait until you reach the last line of the code to realize that you do not solve the problem required by customers which usually be illustrated as until reaching the end of the ladder- your career and life to realize it is lean on the wrong wall.

[In this algorithm, programmers are required to check if the sub array is included in the array and return the rank of number in array that matches with first number in sub array. If the array does not include the sub array, then the system has to return -1] 

2.  “Finding a niche” (or the overlapping)

Narrowing down your market. In this algorithm, I eliminate cases that are obviously wrong from first sight which will definitely result in -1. This helps the system to stop starting the loop in those specified cases and saves a lot of effort for the system. In career path, you have to define area where you skills and domain that you are good and passionate at matching with huge demand in the market which can be illustrated as the overlapping between surplus and scarcity segment in finding startup ideas by Sangeet. Seth Godin said “Small is the new big”. For business, it will help you to know your ground, which market or customer segment that you won’t touch (at least at the current stage) so you can be super-focused, go lean, reduce unnecessary burning rate and run faster in the marathon.

Eliminate wrong cases in Coding and Finding niche market

3.  “Setting key metrics”

Most of algorithm has loops which works like iteration in startups. We have to understand the current state of the business/ life/ career and to plan in advance goals, actions that we want to achieve in a specific time frame. In business and startups, we have to clarify definition of each key metric and to set out targeted metrics for each iteration weekly or bi-weekly so that other team members can understand from looking at your plan or lean dashboard by Pollenizer. Otherwise, we cannot measure growth rate, burning rate, whether achieving targets and may reach nowhere in the end (or even loop forever till system crash). The same in career strategy, what if you do not know which industries, domains, areas, skillset and network that you want to develop throughout your life and what is the expected growth in each development cycle, you are just a zombie, die trying.

Key Metrics in Programming Loop and Startup Iteration

 [“i” which is an integer (int) is the metric to be assessed during i < a (a = predefined period). “i” will start with value 0. After each loop “i” is increased by 1 which means that the loop should have a – i (after + 1) to go before ending the loop]

4.  “Working backward”

For this algorithm, instead of jumping into comparing integer by integer which I used to do 2 years ago (lines of code will be shorter but it will take more time for system to work on – inefficient). Now I start by looking for all possibilities to solve it and always keep in mind “Is there a better way for the current one?” So that I can lay down right strategy to approach the problem. Because we are required to return the position in array that it starts to match with sub array. So when I start backward from last digit, the final checked integer will also be the position I am looking for.

The same as in career, after choosing the right path, you start planning backward from your dream – goals – long term – short term – action plan like in this article, not the other way around. How about business? It also follows the same rule but the only difference is to start with vision/ mission of the company – being acquired, going public and continuing to run it. However, in startup world, we have one more pre-requisite step which is problem to be solved before going to vision. Therefore, the full reversed path for business is (problem) – vision/ mission – goals – long term – short term – action plan.

Looping Backward in Programming and Working Backward in Business

5.  “Knowing when to stop” (It’s enough!)

When you reach this step, congratulate to you! #Awesome! You have set your goals, metrics and strategies. You are running your business smoothly, developing your career path successfully with your deepest passion. It seems that nothing can harden your way now. What if one day you are diagnosed that you’ve got cancer (May be not that bad. Other syndrome can be obesity, fatigue, heart attack, eyesight, bones or joints) due to unhealthy lifestyle and lacking of exercise or receiving warning that your relationship or family on the verge of corruption. Well, you know what will happen for sure if you don’t hit the brake. This step is usually missing in most of people’s plan. In algorithm, programmers always have to define circumstance that will stop the loop or terminate the running code immediately and return error.

Ending Condition in Programming and Know when to Stop in Career

In Dec 2012, founder of Anphabe – Vietnam’s LinkedIn shared at an event that before she start this company, she worked for … which required her to travel a lot.  Until one day, during her overseas business trip, she received a call from her husband that their child was in severe sickness at the hospital. Then, she immediately returned back to Vietnam. After their child recovered, she knew it was enough for her in achieving a lots in the corporate world that she decided to startup.  From this story, I have learned that we should set key milestones when we will check back what is important to us whether it is in “red zone” or still safe. Everyone has different criteria and priority ranging from health, money, wealth, position, family, love, friends, personal development and hobbies… which we better picking out only 3 to 5 key elements, set key metrics and specific time frame when we review them back.

Extras: Habit Development Model

I develop this further from Grace Bella on rewarding and adopt from the method in “The Power of Habit” by Charles Duhigg.  A habit is developed through time when there is a cue to ignite the action (routine) with a reward upon accomplishment. I go further with the negative result which help us to realize what will happen if we don’t do the activity. Moreover, it is widely spread that motivation is not really a good push anymore whereas fear becomes a replacement to take you further. In this tool, it even trains you to face your fear every day which is the only to overcome it.

If Else Condition in Programming for Habit Development
If Else Condition in Programming for Habit Development and Personal Development

Recommended Reading List:

 

One Response

Leave a Reply