How to Write Algorithms

Yann Mulonda
3 min readOct 8, 2018

--

Coding: Problem Solving Techniques

I recently had interviews with 2 of the big 5 IT companies (Facebook, Apple, Amazon, Microsoft, and Google). I spent a few weeks preparing for my Onsite interviews. During that process, I learned some valuable lessons that go behind just passing an Interview and will help me become a better software developer.

Programming Language

Every person who can speak more than one language, regardless of the level of proficiency in other languages (bilingual or multilingual), has a primary language. One of the languages in which a person feels most comfortable expressing herself/himself.

The same goes for people who can code in more than one programming languages. While being fluent in multiple programming languages might be advantageous and somewhat “impressive”. It’s very important to have “one primary programming language in which you feel most comfortable writing code.”

I first did a self-evaluating and determined which of the programming language I was going to make it as my primary coding language. I picked python as it is the latest programming language I have learned and used for most of the recent projects. I then started practicing to improve my coding skill and gain mastery by solving algorithms questions and coding challenges.

Solving skill

The approach we use to solve problems plays a big role in the efficientness of the solution. The better approach to writing an algorithm is to first think on draft or paper and “make sure you have the right solution in concept before starting to write the code.” This approach helps you better understand the question itself and what is asked. Simply analyze and try to solve the problem in the most basic human way without going into any sort of implementation of computer science techniques.

Coding is simply the translation of your solution concept into a computer language that implements the solution. The followings are sample problems and solutions that better illustrate this solving skill approach.

(please read the comments above the code for information the solution concept that leads to the code implementation of the solution).

Palindrome

Write a function which accepts an input word and returns true or false if there exists an anagram of that input word that is a palindrome.

Hash Table

Given an array list of numbers, find a pair of numbers that adds up to 10.

Array — List

Given an array-list of integers, write a function which takes the given array, finds and returns the second largest number in that array.

String

Given two string of numbers, string1 = “107” and string2 = “87”. Compare the two strings and return “True” is the number in the first string is greater than the number in the second string without converting the Strings to Integers.

If you enjoyed this story, you might also like “The feeling behind the Impostor Syndrome

Please give it a few claps for support!

Cheers!!

📝 Read this story later in Journal.

👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.

--

--

Yann Mulonda

Co-Founder & CIO @ITOT | DevOps | Senior Site Reliability Engineer @ICF󠁧󠁢󠁳󠁣󠁴 | "Learning is experience; everything else is just information!”