Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Getting better at algorithms

I've been looking at jobs to apply for with my growing Treehouse smarts and most of them have tests or requirements based on using algorithms and managing time complexity. I understand these concepts on the surface and Treehouse has done a good job teaching me how to better code things, but I was wondering if anyone had any suggestions for getting better at Algorithms and managing the complexity since that will be what I need to get in the door to a lot of these positions.

Any type of resource works (book, website, etc)

5 Answers

Mike Wittenauer
Mike Wittenauer
17,095 Points

Hi Robert, There are some great websites out there that focus on algorithms/problems. They generally give you a problem to solve with code and you go off and solve it and have a community of programmers ready to tell you how to make your code better and more efficient. Here are just a few I'm familiar with that have helped me a ton: exercism.io, codewars.com and hackerrank.com. Hope this helps!

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,077 Points

The best way in my opinion is to just practice writing these algorithms and data structures yourself, I will provide some resources for you below:

Take Courses Online

Practice Interview Questions Online

Reading Articles From other Programmers

By using these tools and the internet in general, you should be able to implement many of these algorithms pretty easily.

Thank you both! I will go ahead and work with these tools in the coming days to see if things start to click more.

I am taking the edX course called "Introduction to Computer Science in Python" that is free, but I think the course has already ended. I'm fairly sure that the videos are still on YouTube, though!

Hi Robert,

This is something that you need to keep practicing on.

A few more resources:

Cracking the Coding Interview This one is well reviewed and gets recommended a lot.

project euler .net It's recommended to solve the problems in order.

empire of code If you want to play a game while solving the code challenges. Last I checked, you can use javascript or python.

Also, don't be satisfied with the first time you get the solution and don't be tempted to move on to the next problem. Try to investigate whether you've found the most efficient solution or not. You may have found a polynomial time solution to a problem but a linear time solution exists, for example.

If you come up with a naive/brute force solution during the interview then you may be asked if there's a better way to do it. You could be in trouble there if you always settled for anything that worked when you were practicing.

Good luck!