Data Structures and Algorithms: Why You Need Them


FAANG - Why you NEED to learn data structures and algorithms

If you want to be a great software engineer, you need to learn data structures and algorithms. Most technical interviews for software development jobs will test your mastery of data structures and algorithms. This is especially true of the larger tech companies such as the infamous FAANG (Facebook, Amazon, Apple, Netflix, and Google).

But what exactly are data structures and algorithms? How will they make you a better software developer? And what’s the best way to learn data structures and algorithms? All of these questions are answered below.

What Are Data Structures And Algorithms?

Data Structures and Algorithms are actually two separate things. However, they are frequently taught together as one course because they work hand-in-hand with each other. To best explain what data structures and algorithms are, let’s first talk about each of them separately.

Algorithms

It may sound like a difficult concept but the definition of an algorithm is actually very simple. An algorithm is simply a set of rules to follow that solves a specific problem. A good example would be an algorithm that calculates how much taxes you owe at the end of the year based on certain inputs (income, deductions, location, etc.) and certain rules that calculate the final amount (subtract deductions, apply tax rate, etc.).

Another good example of a real-world (non-computer) algorithm is a cooking recipe. There are certain rules to follow for a recipe which, when executed as instructed, will yield you the exact result specified in the recipe. I.e. if you follow a certain chocolate chip cookie recipe, it will produce 12 uniform cookies each time. That’s all an algorithm is.

Data Structures

When creating an algorithm for a computer program, you will ultimately work with data (numbers, words, letters, phrases). If you have more than a little data, it helps to organize that data into some sort of structure. Even if you’ve never programmed before, I’m sure you’re familiar with the concept of a list. Lists are a type of data structure.

When you make a grocery list (because you have to make 12 chocolate chip cookies) you’re structuring your data so that you can easily process it. That’s what make’s a list an efficient structure for organizing your grocery data.

In addition to lists, there are other ways of organizing data. Common data structures include stacks, queues, trees, graphs, hashes, and heaps. Depending on the problem, different data structures will be more efficient than others. But why do you need to choose the most efficient data structure?

The answer is simple: scale.

Why You NEED To Know Data Structures And Algorithms

When creating large scale programs (used by a lot of people) your program will have to process a lot of data efficiently. The more users a program or application can handle, the more customers it can have, the more money it can make. That’s also why large tech companies can afford to pay their software engineers a higher salary on average than smaller companies.

A great resource to see the difference in pay at these tech companies is with level.fyi.

Here’s a list of how these top companies hire people.

Reason #1: You want to work for a top tech company

Personally, I want to work at Google when I graduate. I’ve used so many of their products for many years. I’m typing this right now on my 5-year-old Chromebook. I would love to work on Google search, YouTube, possibly something completely new. Personally, there are four reasons I think someone would want to work at a big tech company:

  1. It’s a great learning opportunity
  2. It’s a great work environment
  3. You solve challenging/rewarding problems
  4. The pay is usually above industry standards

Whatever the reason is, if you want to work at any of these companies, you need to be well versed in data structures and algorithms. However, I have heard on more than one occasion of smaller companies with similar interview processes. Which leads me to the second reason you need to know data structures and algorithms.

Reason #2: You want to work at any company

Increasingly I’ve heard of small to mid-size companies that aren’t primarily tech companies focusing on data structures and algorithms in their technical interviews. This is often preceded by mocking because it shows that these companies probably don’t know the best way to interview their potential software engineers. Why do I need to know how to reverse a linked list to work on your companies web application?

Every company is different and has different hiring policies. That means you should prepare yourself for the position. Not all jobs require that you know data structures and algorithms but some will test you on it regardless. Besides, data structures and algorithms are truly powerful programming concepts. Which brings us to the third reason to learn them.

Reason #3: You want to create something that can scale

This is really the main reason you need to know data structures and algorithms. The first two reasons are really extensions of this reason because companies want engineers who build products that scale. That’s why they’re willing to pay so much and offer such great benefits.

If you don’t want to work at a top tech company (or any company), knowledge of data structures and algorithms will allow you to build your own scaleable product or application. If you can make something solves a small problem for a lot of people you could potentially sell that software for millions, like Nick D’Aloisio.

What’s The Best Way To Learn Data Structures And Algorithms?

Before learning data structures and algorithms, you need to know the fundamentals of programming, including Object-Oriented Programming. Once you know the basics, then you can learn how to build scalable systems.

Free Resources

These are the free resources that I personally have used to learn data structures and algorithms in Python and Java. I personally really love learning from books and videos, but be sure to go through the exercises. Mastery of programming comes from hands-on experience, so don’t just consume the content; put it into practice.

Paid Resources

I personally haven’t paid for any resources to learn data structures and algorithms, unless you count the college course I took on the subject. However, if you were looking for a full-on course, these are the top-rated courses on Udemy that I would purchase if I so desired to purchase one.

Interview Preparation

If you really want to master data structures and algorithms and get that job at FAANG, there’s one thing that will help immensely. AlgoExpert is designed specifically to help software developers like you and me to prepare for technical interviews. The creator, Clément Mihailescu worked at Google and Facebook before developing AlgoExpert.

You can program your solutions in many different languages and if you get stuck, there are multiple hints and video explanations. They did an amazing job creating all the questions and the user interface is so smooth. This is the best course out there for interview prep and it’s certainly the one that I’ll use when preparing for my Google interviews!

I hope you found this helpful and I wish you all the best in your future.

Tim Statler

Tim Statler is a Computer Science student at Governors State University and the creator of Comp Sci Central. He lives in Crete, IL with his wife, Stefanie, and their cats, Beyoncé and Monte. When he's not studying or writing for Comp Sci Central, he's probably just hanging out or making some delicious food.

Recent Posts