PACER: Structured process to solve programming problems
Solve programming problems in a structured and deliberate way

Hi, I am a programmer, teacher and entrepreneur. I love creating internet products that improve people ‘s lives.
If you have the time, continue reading to know more about my experience. If you rather want to check my LinkedIn profile, please go ahead.
I was born in Bogotá, Colombia. Colombia with “o" not “u". My grand father from my father’s family was Lebanese, that’s why I have this non Colombian name.
When I was a teenager I loved computers, video games, philosophy and playing instruments. I remember that I used to go to the Luis Angel Arango library in Bogotá to study HTML, CSS, and MySQL from books, yes, from books, I didn’t even had a computer back then (early 2000’s).
I graduated in Colombia from a business School, but to be honest, I spent most of the time studying logic, philosophy, and anthropology, mainly from what is now days related to user research and how to apply it to create products and experiences.
Europe, data, machine learning, and my first IT businessIn my early 20’s I moved to Europe and worked at Dell Computers. I also did an MBA. This experiences helped me realize that what I liked the most was technology and how it could serve people to improve their lives.
Paradoxically, the best teacher I have ever had in the business strategy field, had an undergraduate degree in philosophy, not business. At the time he was my teacher, he was also the main strategy adviser of an important retail firm in Europe. I will always thank him to introduce me in the world of conceptual thinking. Thanks Manuel!
Trying to strengthen my skills in the technology field, I moved to France, where I studied a Master in the field of Data Science and Machine Learning. At that time, around 2008, my work for the master was mainly focused on how to capture, classify, visualize and make decisions based on data.
My studies in that field helped me create and sell my first product that turned into a business. A simple solution to capture and visualize data that served small businesses and universities to make decisions.
After selling my first business, and visiting different countries with the purpose of expanding my vision of the world while interacting with several cultures, I came back to Colombia with the willing of supporting the largest amount of people I could.
Helping people, my mantra for the following yearsI wanted to help people the right way, so I decided to prepare my self on education. I enrolled in a short course from Harvard with professor David Perkins, which taught me the Teaching for Understanding education approach. From that moment on, I discovered I loved education, and how it is a great way to help others. (Additionally I started studying "learn how to learn", and started following Barbara Oakley approach)
As I wanted to help people in an efficient way, I decided to work close to the main universities in Colombia. After that, I decided to come back to Europe, but the Colombian Ministry of Information and Communication Technologies invited me to co-create with a great team what today is known as Apps co, the largest IT entrepreneurship program in the region and the one that kicked off the entrepreneurship mindset of thousands of Colombian entrepreneurs - along with other initiatives executed by great people from other Colombian institutions like Innpulsa, SENA, and the MInistry of Commerce - .
By this time, early 2012, I met Bob Dorf, Steve Blank and Alex Osterwalder, who helped us improve the Apps.co program. From this point until today, Bob became my mentor, friend, and business partner for some endeavors around LATAM. Thanks Bob!
I invested a year travelling around the country helping entrepreneurs and institutions to strengthen their entrepreneurship mindset and skills.
After that fulfilling experience, I invested almost 2 years working in Colombia and other countries like Mexico and Brasil.
I helped entrepreneurs from different accelerators and several corporations that started to implement innovation methodologies to launch new internet products to the market (Google, Telefónica, Stone, among others)
My new adventure: EdTech and Software as a ServiceAfter this amazing experience helping people getting their projects done, in 2014 I decided to create a platform to help all those who wanted to learn how to start something from nothing. I wanted to write the code and create the content myself.
My coding skills by early 2014 were mainly related to what you need to work in high intensity data manipulation, but poorly related to web development. I started looking for the best place to learn web development in Colombia, based more in the experience of the mentors rather than the certifications or diplomas, and I am so grateful that I met German Escobar, the person who has became my friend and business partner for the last decade.
Germán Escobar started Make It Real in 2014, after creating and making grow his other business, the largest SMS communications company in Colombia and Perú.
For me, he was the reliable person to learn from about web development. My thought at that time was : “He is not only a great programmer, but also an entrepreneur who knows by experience in the field how to deploy products to production that need to support millions of interactions in real time ". I decided to learn web development from him.
I became a business partner at Make It Real. After graduating from its first training batch, I created Innovation Lessons, a platform used for thousands of early entrepreneurs in LATAM, and later with German we created ConvertLoop, - at the beginning because we needed it for Make It Real - (I will write an article sharing the ConvertLoop experience and how we tried to avoid a "market street fight").
Being partners at ConvertLoop and Make it Real, we decided I will focused on ConvertLoop and he will keep his attention on Make It. Late 2019, after 4 years of hard work, we sold to a corporation the advanced data analysis and smart segmentation algorithms we wrote for Convertloop.
Today, I dedicate my time to teach and create products and experiences for EdTech. I write code for personal projects at least 4 hours a day, and I will share my previous and upcoming experiences on this blog.
Stay tuned!
Thanks for reading,
Nayib Abdalá
When you are new to programming, you face different challenges that, if simplified, could be reduced to three layers:
- Logic layer
- Syntax layer
- Productive layer
The logic layer refers to your capability and skills to understand a programming problem and suggest one or more ways to solve it. The syntax layer refers to your ability to write code in a given language, using its syntax and specifications, and the productive layer points to the set of tools -frameworks, libraries, technologies...- and best practices, technical and soft, that you have worked with and have experience in, so that you can be productive in a given job.
I'm going to share with you a process I have named PACER (Problem - Algorithm - Code - Execution - Refactor), that will help you create a mental model to solve algorithmic problems in a structured and deliberate way, so that you improve your logic layer skills.
This process is the result of studying and testing different approaches to solve programming logic problems for over 10 years.
The PACER Process
Problem
- Define the problem in your own words: This helps you go through a cognitive process to validate that you understand what needs to get solved.
- Input/Output: Identify the expected input and output data types. This step allows you to state what data types/structures you get as an input and what data types/structures you need to return from your solution.
- Examples: Write some examples of the expected results based on examples of the input data. Use a desk check (manual computing) to understand what output you should get from a solution, given a specific input.
- Edge cases: Ask or suggest (when not in an interview) the edge cases that the solution should cover. This allows you to identify cases you might cover that are not explicitly shown in the problem statement.
- Restrictions: Write down the restrictions/rules that are given to the problem in order to set the boundaries of your solution.
/*
PROBLEM
Write a function that shortens a string of characters fro a - z as follows:
If the same character repeats consecutively twice, eliminate it from the string.
Return the shortened string.
- Input: string
- Output: string
- Examples:
"aaabccddd" -> "abd"
- Edge cases:
* What should I return if I get an empty string
* What should I return if I get a data type or structure different from a String
- Restrictions:
The string characters are a-z
*/
Algorithm
In English, write down the step by step you plan to follow so that you transform the input data into the expected output.
/*
ALGORITHM
Option 1
Define a function superReducedString( ) that receives a string - str - as a parameter
declare a variable newString and assign an empty string as its value
iterate over every character of the str
if the character is different from the last character of newString, add it to newString
otherwise eliminate the last character from newString
return newString
Option 2 - Regex + Recursion -
Define a function superReducedString( ) that receives a string - str - as a parameter
declare a regular expression that matches two equal consecutive characters
call the string match method to see if there is still duplicates
if null and str length is 0, return "Empty String"
if null return str
otherwise, call the replace method to replace/eliminate the two equal consecutive
characters and pass the returned value as the string parameter to call the function
recursively
*/
Code
Translate the steps of the previous algorithm into a programming language of your choice.
// CODE
// Code for algorithm - option 1 -
function superReducedString(str) {
let newString = "";
for(let i = 0; i < str.length; i += 1) {
if (str[i] === newString[newString.length -1]) {
newString = newString.slice(0,-1);
} else {
newString += str[i];
}
};
return newString[0] !== newString[1] ? newString : "Empty String";
}
// Code for algorithm - option 2 - // Using regex and recursion
function superReducedString(str) {
let regex = new RegExp(/([a-z])\1/, "g");
if (str.match(regex) === null && str.length === 0) {
return "Empty String";
} else if (str.match(regex) === null) {
return str;
} else {
return superReducedString(str.replace(regex, ""));
}
}
Execution
Execute the code to validate that the test cases are returning the expected result.
You are normally given the test cases as part of the problem. In our example, the following are the test cases and their corresponding expected result:
console.log(superReducedString("aaabccddd")); // "abc"
console.log(superReducedString("cccxllyyy" )); // "cxy"
console.log(superReducedString("aa")); // "Empty String"
console.log(superReducedString("baab")); // "Empty String"
console.log(superReducedString("fghiiijkllmnnno")); // "fghijkmno"
console.log(superReducedString("chklssstt")); // "chkls"
Refactor
Think about the following:
- How could I make this code more readable?
- How could I make this code more efficient in terms of time complexity (takes less iterations/"time" - and space complexity - uses less memory - Big O Notation )?
- Think about edge cases that you might not have covered yet and apply the PACER process from the Algorithm step to change what is necessary to cover the new cases.
/*
REFACTOR
This example shortens the lines of code written
*/
const regex = /([a-z])\1/g;
const superReducedString = str => regex.test(str) ? superReducedString(str.replace(regex, "")) : str || "Empty String";
console.log(superReducedString("aaabccddd")); // "abc"
console.log(superReducedString("cccxllyyy" )); // "cxy"
console.log(superReducedString("aa")); // "Empty String"
console.log(superReducedString("baab")); // "Empty String"
console.log(superReducedString("fghiiijkllmnnno")); // "fghijkmno"
console.log(superReducedString("chklssstt")); // "chkls"
You can check out the complete example here
You can watch this video with the process applied in real time - Audio in Spanish -
If you want a simpler problem, feel free to pick one form the repositories below or follow through this one - in Spanish -
Open repositories with examples
Problems you are going to avoid with PACER
- Start writing code without really understanding the problem you have to solve.
- Write a solution to a problem without considering alternative solutions.
- Waste time writing a solution that does not consider edge cases.
- Writing invalid or incomplete solutions to algorithmic problems.
- Writing solutions that return the wrong data type or data structure.
Platforms you can use to practice your programming logic skills
If you have any doubts, send me a direct message via LinkedIn and I will get back to you ASAP.
↩ Big O notation: It’s a way to describe how the runtime of an algorithm grows as its inputs grow. In other words, it is a way to describe how the number of operations to execute an algorithm increases as the input of data to the algorithm increases. Some resources you may want to check out Big O Notation 101, Big O notation calculator
Note: The programming problem used in this blog post to showcase the PACER process was taken from the Edabit
Special thanks to all those who have helped me become a better programmer.
