Best way to learn Algorithms?

feeling discourage… I am constantly stuck on every single problems in this section.

I will get parts f the problem, but always end up looking at the answers…
Part of me is happy for getting parts of the answer, but I have yet to get a full answer right…

What am I doing wrong here? I will write out the needs to be done, then execute the code, looking up methods etc…

Does anyone recommend a good way to solve a problem? Also are algorithms used in jobs?
Like I’ve seen how my developer friends use javascript in their code, and some of them tell me you don’t need to know algorithms for work in regular front end jobs… thats not how JS is used when doing web dev… yes some companies will test you in JS algorithms… but I feel I’ll never be an algorithms master…

2 Likes

Somethings can only be learned by struggling through them. There isn’t a shortcut or some special technique beyond building up skills through experience. Rather than look up the solutions when you get stuck, I strongly recommend that you come to the community and talk about where you are in the challenge. As you say, you are getting parts of the solution. Other members of this community will nudge you in the right direction to connect the dots. That means that you are still going through the process of solving the problem. It’s like the difference between learning to ride a bike by watching a video versus learning to ride a bike with training wheels.

An algorithm is a logical process that will produce the same, predictable, result for an input every time. Being “good at algorithms” means that you can write a logical solution to a problem that is elegant, efficient, and robust. That’s also what being “a good programmer” means: front end, back end, or full stack.

2 Likes

I’m assuming you’re at the basic algorithms section? I struggled a bunch there as well. It’s basically the first time you’re using what you’ve learned in JS without your hand being held. I had the same problems though, you can write out what needs to be done but you struggle finding the exact code that works. Give your self a set amount of time for each challenge and if you can’t figure it out then look at the hints. Don’t feel bad if you have to look, just make sure you understand what you looked at. Each day go back and do the ones you’ve already completed just to make sure you understand what’s going on. I know there were some where I thought maybe I understood it after looking at the hints but each time I re did it I actually started to understand it even more. It’ll help build confidence as well. You can also do algorithm challenges on other sites (there’s tons) each day to help you get use to the methods and such. Once you get to the point where you start working on a project that’s when you’ll really start feeling comfortable with algorithms. Just remember plenty of other people felt the same way as you (myself included) so don’t let get you down.

4 Likes