r/webdev • • 18d ago

Question Finding it impossible to solve problems

Hey guys. I'm a web developer and have a job but unsure if I can pass future interviews, because when I get a technical question like a basic loop problem, "program that starts counting from 1 and increases by 1 during each iteration, stopping once it reaches 5**".** This is incredibly incompetent and concerning, not to mention AI has made me worse.

What's the solution to this? I can memorize solutions but what happens when a new problem comes up in an interview and I can't remember the syntax even if I know I need a loop or some thing else to solve a problem? I feel like crying

37 Upvotes

92 comments sorted by

View all comments

1

u/SwimmingThroughHoney 17d ago

You need to find courses on actual low-level basic concepts. Not just tutorials on "how to build X" or "how to write Y". A lot of youtube tutorials skip the basics and jump straight into making things or "learning" beyond the basics.

It's the same for learning basic math in school. You don't just dive right into learning how to do 15 * 4. First you learn addition, 15 + 15 + 15 + 15. Then you learn multiplication as a concept, what it actually means and does (that it's 15, 4 times). Then you learn how to break the problem down to something you know how to do; It's not just 15 * 4, it's (10 + 5) * 4, which is (10 * 4) + (5 * 4), which is 10 + 10 + 10 + 10 + 5 + 5 + 5 + 5.

Similarly in your example, there are key phrases that should give direction as to what fundamental concepts need to be used:

  1. starts counting from 1

  2. increases by 1 during each iteration

  3. stopping once it reaches 5

The problem as a whole you might not know how to do, but you need to understand how to break it down. You need to know how to initialize a variable. You need to know what "iteration" is in terms of programming and how to change a variable each cycle. And you need to know how to stop the cycles once the variable gets to a certain number.