# How Learning Data Structures and Algorithms Helped Me Ace My Coding Interviews

10/11/2018

I remember walking into my first technical interview for a software engineering internship. I didn’t know what to expect, for I did no preparation whatsoever and assumed whatever I learned in class up to that point would carry me through the interview.

Oh, how I was wrong.

I walked into a room containing one other person and a whiteboard. The attention was on me.

The interviewer asked me to write a program that, given a start position and an end position in a matrix (a two-dimensional list or array), would find an optimal path from the start position to the end position.

Not having taken an algorithms course yet, I wrote a program that went through most values in the matrix to find the shortest path.

The interviewer then asked me how I would optimize the program.

I stood there dumbfounded.

Not knowing how to solve the problem at hand, I asked the interviewer for a hint (totally ok to do this if you are ever stuck in a technical interview!). But even with the hint, I was confused. I failed the technical interview and didn’t get the job.

Although the interview was demoralizing, I felt that with the right preparation I could go back and tackle the challenge. The following semester, I signed up for a data structures and algorithms course.

After taking the course, I reflected back on that first technical interview. I realized that with the use of an A* algorithm, that question wasn’t hard at all! I could have optimized my move at every cell in the matrix to find the shortest path. Not knowing those data structures and algorithms cost me a job.

Not only did the course give me a better grasp of programming fundamentals, but it also made me think of the world differently. All of a sudden, I started modeling and navigating the world through an algorithmic lens.

I would represent my walk to class as a graph of vertices and edges and use the A* search algorithm to figure an optimal path. I would use binary search to search through the library bookshelves until I found the book I wanted, as opposed to looking through the books one by one.

Furthermore, knowing these data structures and algorithms also helped me build some cool stuff on my own! I built an application similar to Google Maps that would route the shortest distance to my classes. I also helped build a code style analyzer that uses a clustering algorithm to automatically provide hints and improve people’s code! The possibilities were truly endless.

Learning how to apply data structures and algorithms not only provided me with the necessary knowledge to start a career in software engineering, but it also instilled a confidence in me to reach out again and try to conquer technical interviews.

The year following the course, I once again began applying for software engineering internship positions. I made it through to some technical interviews and began applying what I learned in class to the problems they gave me.

I was asked variations of traversing graphs, sorting through lists, searching through datasets, and more. I was able to show off my ability to think optimally, and this algorithmic thought process landed me a couple of jobs, including one at Codecademy.

At Codecademy, I was honored to work on a team creating the Computer Science Basics: Data Structures and the Computer Science Basics: Algorithms Pro Intensives.

These courses teach the underlying principles of strong programming fundamentals, so you can apply them in your own job searches and careers. I hope you take the courses, and I am excited to see where your learning journey will take you.

7 articles

# 11 Full-Stack Developer Interview Questions

03/28/2024

We’ve compiled the most common Full-Stack Developer interview questions with tips for answering and how to keep your programming skills fresh.

# 20 Front-End Developer Interview Questions to Practice

03/27/2024
6 minutes

Review these common Front-End Developer questions, then practice interviewing with our new Interview Simulator.

# You Landed a Job Interview — 8 Ways to Get Ready Now

03/27/2024
6 minutes

Respond to the interview request, then check out these tools and tips.

# Loved Code Review? Try These Data Science Courses Next

12/27/2023
3 minutes

Dive even deeper into data with these courses and paths.

# What Boosting Retention Looks Like During “The Great Resignation”

10/21/2021

People are leaving their jobs in record numbers. But as the “Great Resignation” continues on, employers have an opportunity to better support their teams and ultimately boost retention with an increasingly popular solution.

# How To Make a Web Developer Portfolio

05/25/2021

Need help creating a web developer portfolio? Learn what to include (and what not to include) to make a great first impression with employers and clients.