Struggling with basic algorithms

I already have a bachelors in a CS related field and graduated a year ago. I feel like I don’t know anything since my major taught me too many things but never in depth about them or even really focused on algorithms. Since about February I’ve been starting to teach myself more code here and with the Odin Project since I do not feel ready for a job at all. I’m doing the basic algorithms and for almost all of them I have to look at the solution. The wording or how the problem is described to me just doesn’t make any sense.

I’m on the “Where do I Belong” one and I do not understand what it is asking at all. I can sort of start some of the problems with a for loop or something but not the actual logic I just can’t grasp. I feel like I’m not learning a lot since I have to constantly look at the solutions. Is there some way I can understand these things better? Arrays quickly overwhelm me and I just get stuck. The hints barely help me.

I just feel like since I’ve been coding most of the time I was in college I should understand these basic ones but I just don’t. Anyone have any advice or help on understanding the questions or how to approach when you just have no idea besides checking the solution?

A lot of people struggle with algorithms, even good coders.

Perhaps you would benefit from watching others. If you look on youtube, you can probably find people going through their solutions.

3 Likes

True. I looked up a few videos on someone working through problems and it made a bit more sense. I just get overwhelmed especially with 2D+ arrays. I’m just so used to working with C#/Unity so its much more visual when you make changes to your code rather than just looking at the console to see results. I know I’m a slow learner any everything but like wow I feel stupid? haha. I just feel like I’m never gonna be able to work through these basic algorithms by myself. I have the worst time organizing my thoughts to be able to work through them step by step.

Thanks for your response!

then ask for help

we have a lot of people that give some of their time in helping people work through the challenges, without giving the solution but just some
guidance

problem solving is a skill that needs to be developed.
After that do not stop at the curriculum, there are a lot
of algorithms in the Interview Prep section, there are also many other websites in which you can exercise your problem solving skills (codewars, codingames.com etc)

keep practicing and it will get better

2 Likes

Hi :slight_smile:

I find there is a big gap between “problem solving” and algorithm writing.
What I mean is, I’ve the feeling that there is the problem solving part and, there is the translation to the algorithm/function/loop on an other part.

I’m not so bad on logical and problem solving, but I find it difficult to transpose the idea of all steps from the problem to resolution into a function or something like. I could write a solution in text but I’m not able (yet) to translate it into programming langage.

In my head, what I want to ask is clear as if…do…or don’t…and don’t and do…
but, I’m still not able to figure what the program need as instruction and what kind of instruction. Should I use this to access this and modify this or can I ask to modify directly…? Should I start from something with != or == ?

I have the same “issue” approach with R and javascript. I can do small steps with.
Ex : in R, I’m able to ask for barchart with some options but, when time comes to ask R to have multiple barchart for different variables I’m stay like uuuuhhh how start, what ask first ? how does it react if I ask this before this…

So I do a lot of trials and errors and even if I feel me really frustrated, I try to keep the step by step progress in mind. I read a lot into documentation but it is not super user-friendly when you are still “new” in the field and unfamiliar with a lot of concepts. So becoming familiar ask time. The same if you want to look at functions from other people…sometimes it’s just like wtf, it needs so much code to ask that ??? How can I deconstruct that to understand each part…and start by one part…

I hope that having a look on hint, video or ask guidance or even at the solution is not really a problem during learning phase. At the end, the specific learnings of a practice can be moved to something else and used in other situ. The key is to understand the global idea and be able to play with it in a range of different cases, then adapt it to something new.

@eupehemius I find interesting what you said about your major :

I think school gives you a border-box, if you want to see more than the border-box it’s your “private” concern. We could discuss if the point it’s bad or not but…Have good time with your quest, dealing with frustration in a constructive way <3 Keep learning

1 Like

I know this is just a bad excuse but I just think about well, I would have to ask for help for almost every single algorithm and that would take so long! But I know I need to be patient and just ask for help since it’ll help me learn. I just feel like I shouldn’t need help so that just reaffirms my thought to not actually asking when I’m frustrated. I just gotta get over that haha. Thank you!

1 Like

Yeah I think I’m learning that… it’s like word problems in math. I’ve always had problems figuring out where to start with them since you are given so much information. I agree! I see some of the solutions and its like wow why is this code so long?? I usually can deconstruct the solutions to make some sense but I feel like I couldn’t come up with the solution by myself. ): I guess I feel dumb asking for help cause its like I have a bachelors degree so I should be able to do this by myself right?? And then I get frustrated when I can’t. I was the first graduating class for the major I was in since it was new so I was a guinea pig basically and feels like they screwed me over by not really teaching me a whole lot and having a very unorganized curriculum and class structure.

I’m glad I made the choice to learn more and it’s definitely forcing me to handle my frustration differently. Thank you! (^:

It’s like a lot of things - the more you do it, the easier it becomes. And the more algorithms you do, the more you get a “spidey sense” on how to solve new ones. It comes a little easier for some in the beginning, but everyone reaches a point where the have to work at it. But if you struggle with it, it’s a good reason to work at it.

Of course, solving toy algorithm problems isn’t the only skill a dev needs. It may not even be the most important, depending on what kind of work you do. But it is usual and it is good training. And they show up on a lot of interviews so it is a good skill to develop. But don’t freak out and don’t get discouraged.

2 Likes

I had some remote courses (due to covid…) on R friday and saturday with a statistician.
We are 16 adult student (most part are working) but, we come from different fields : business, marketing, healthcare, social sciences, computer science. We all have at least a master degree.

We had to work on a “simple” algorithm : Bubble Sort. At the end of the day, only 2 people were able to write the function in R.

I was really frustrated because :

  • Teacher only listed us the command in R…You know like there are those commands…blabla…but no deeper explanation

  • He said “it’s easy” - “you can have a look on the help with ?command, it’s easy”

Should I feel me numb because he said it’s easy ?
I have no doubt that all the info are into the help. But saying it’s easy is like :
Hey read this book for children it’s easy but, you are not able to read…so…not so “easy”

So the idea is : how could you resolve an algo like bubble sort, if you are not able to figure how to do a correct nested if else statement ? With the bubble sort you have : for, if, numbers which are not numbers anymore but become letters to generalize the process…

So, after my comment yesterday I tried an other approach ! I started with some nested if else statement for simply…x = 5 …
At beg, ask something with 1 condition, then add a second, a third…At the end,
I’m able to do a little game like “find my number” and give some info like “more” “less” “near”. Pfiuuu I was able tot talk to R with R langage and not mine :slight_smile: Also I had a look on codewars, it’s really great (even if R is still in Beta). I really like the idea of doing “kata” with code.

Have a nice codalgo day !

1 Like

you are learning a new language. you are learning how to say things in that language.
and then you are also learning a new thought process.
be nice with yourself, celebrate your successes, and learn from your mistakes.

also remember that looking at a piece of code and understanding what it does is a different skill from making your own code - try going back to those algorithms you looked up the solution for and try to do them on your own

2 Likes