October 02, 2025

Beginner

Understanding Algorithms

You've probably heard the word algorithm at some point, whether in a conversation about technology, on social media, or even in the daily news. But what does this term, so present in our vocabulary, actually mean? The truth is that everyone tends to have a different interpretation of what an algorithm is. If you're still not clear on the concept or have never stopped to think about it, in this article I'll explain what algorithms are and why they matter on a global scale.

Let's go ahead and explore the world of algorithms.

What are algorithms?

When we study at a university, a technical course, or even in programming bootcamps, it's common to come across definitions like: algorithms are a sequence of steps to carry out a task, or algorithms are instructions given to a computer to solve a problem. These explanations are correct, but how do we translate this concept for someone who has never heard of algorithms? That was exactly the question I had, and what motivated me to write this article.

Let's imagine a simple situation:

A guest arrives at your house and your mom asks you to make some coffee. The problem is, you've never made coffee before. If she simply says "make some coffee", would you know exactly what to do? Probably not.

In this case, the simplest solution would be to look up a recipe online. When you find one, you'll have a set of detailed instructions that will guide and help you make the coffee, such as: boil the water, put the grounds in the filter, and pour the hot water. By following these steps, you'll probably succeed. However, that wouldn't be possible without the coffee recipe's instructions teaching you how it's done.

The same thing happens with computers. If we ask them to carry out a task without providing clear instructions, they simply won't know how to do it. That's why it's important that the instructions we give them are organized and clear.

Algorithms in everyday life

In the previous section, we learned that algorithms are a sequence of instructions given to a computer to carry out a task or solve a problem. But did you know that algorithms are present in our daily lives, even outside the world of programming?

In the coffee example, each step needed to prepare the drink, from boiling the water to pouring it into the cup, represents an algorithm, because it clearly defines the sequence of actions to follow in order to reach a result.

To organize and plan algorithms before writing them in a programming language, we can use what's called pseudocode.

💡 Pseudocode is a simplified way of writing algorithms using everyday words, without having to worry about the complex syntax of programming languages.

pseudocodigo-algoritmo

This tool lets you understand and follow the algorithm step by step, making it more accessible and easier to grasp.

How does an algorithm work in practice?

A classic example is a sorting list.

Imagine an old phone book, in which names and numbers need to be arranged in alphabetical order to make searching easier. The algorithm, in this case, is the set of steps that defines how this list will be organized: compare two names, check which one comes first in the alphabet, swap positions if necessary, and repeat this process until they are all correctly sorted.

👩‍💻 These steps make sure we can find a specific name.

However, there's an even more efficient way to sort this list, using a well-known algorithm called Quick Sort.

To understand it better, imagine we have a list of names: Ana, João, Carlos, and Beatriz. Quick Sort works like this:

1. First, we choose a reference name, called the pivot. Let's say we choose Carlos.

pseudocodigo-algoritmo

2. Next, we split the list into two sides: on one side go the names that come before Carlos in the alphabet (Ana and Beatriz), and on the other, the ones that come after (João).

pseudocodigo-algoritmo

3. Now we repeat the same process on each side. For example, in the group with Ana and Beatriz, we choose a pivot (let's say Ana). Ana goes first, Beatriz comes after.

pseudocodigo-algoritmo

4. We do this until all the groups are organized.

5. In the end, the list looks like this: Ana, Beatriz, Carlos, and João.

The secret of Quick Sort is precisely to divide the list into smaller parts until sorting becomes a simple task. It's as if, instead of trying to organize the whole list at once, you solve the problem piece by piece until you reach the complete solution. Pretty cool, right?

Programming languages: the language of computers

The way we write algorithms is through code, using a programming language.

A programming language works as a way for us to communicate with the computer, translating our instructions into something it can understand and execute. In other words, we can think of programming languages as a language, but for computers.

When algorithms start to learn

With advances in technology, it has become impossible to talk about algorithms without mentioning machine learning, also known as Artificial Intelligence (AI).

Every time you interact with a platform, whether watching a video on YouTube, swiping through a Reel on Instagram, watching a Short, or exploring TikTok, you're teaching the algorithm how you think and what you like. That way, it learns to suggest personalized content, so you don't have to keep searching.

The secret lies in machines' ability to process data on a much larger scale than we can. They test countless possible scenarios until they find the ones that best fit your profile. Based on that, they try to predict, for example, what the next video you'll watch will be.

And with each interaction, the algorithm evaluates whether or not it got its suggestion right and keeps learning. The more data it receives and processes, the more sophisticated it becomes and the more accurate its ability to predict our choices.

Conclusion

Algorithms are already part of our daily lives and have evolved a great deal, especially with machine learning; yet we still have a long way to go. The future of algorithms and artificial intelligence promises to transform even further the way we live, work, and interact with technology, and following this evolution is, without a doubt, a challenge as exciting as it is necessary.

Until the next article 💙

Post Author

Leticia Dias

Leticia Dias

Sou desenvolvedora full stack com foco atual em frontend e, nos últimos tempos, me aventurando no universo do design de interfaces. Já atuei como instrutora no curso técnico de informática, onde tive a missão de preparar alunos para o mercado de trabalho. Além do código, sou apaixonada por filmes, séries, animes e tenho um lugar especial no coração para o k-pop.