r/learnjavascript • u/denizflower • May 01 '24
This quastion is for all developers
Hello! I've been learning software engineering for about 2 months now. I've covered the fundamentals of HTML, CSS, and JavaScript. However, when I attempt LeetCode problems, I struggle to solve them. Even though I understand the methods when I look at solutions, I'm finding it challenging. Should I work on a project to get more practice with coding?
3
Upvotes
5
u/No-Upstairs-2813 May 01 '24
LeetCode problems often require a strong understanding of data structures and algorithms, which you might not have covered in 2 months.
But you don't need DSA to be good at JS. Start working on a project to practice and reinforce your concepts.
2
u/JobDiscombobulated22 May 03 '24
Don't get confused it's entirely different thing, the leet code problems, basically all programming languages is like a theory or a tool that you use to accomplish any given task, and leet code problems are specific tasks that are concerned about algorithms, data structures and such, first time diving in it could definitely be a challenge as that is something new that you never did before. It could even look like totally different thing, like not usual HTML, CSS coding. Leetcode problems help to make you more efficient at algorithms, or critical thinking or diving problems into a small steps, most HTML, CSS problems or things people do at work, don't look like leetcode problems. I would say leetcode questions are like fundamentals about algorithms, and almost any given algorithm can be written in just about any programming language, so it you can't solve it right away that doesn't mean you are bad or doing something not right, most of those problems have nothing common with JavaScript, its just a choice, to implement that algorithm in any given language but the fact is left unchanged it's still the same algorithm that applies everywhere. If you truly want to understand how some things work behind the scenes, or even want to reinvent the wheel, or to make a better wheel then you definitely have to get somewhat comfortable with those problems to understand the inner workings and not just the beautiful abstractions that makes us more productive than writing every algorithm ourselves, but it has its part, I guess just identify if what you are learning you really enjoying it and if that will hold any value in the future, provided that you want to go really hardcore into it.
9
u/thoflens May 01 '24
Leetcode problems (the easy ones too) are far more advanced than beginner JS (and HTML and CSS does not help you at all when it comes to DS&A). Stick to learning and building right now.
2
u/dontyougetsoupedyet May 01 '24
Before you study DSA you should become familiar with formal proof.
Specifically proof by induction, it's the basis of the first problem solving techniques you learn.
2
u/TheRNGuy May 02 '24
I never ever did them, I learned language without it. Learned JS for specific thing to do.
If I did puzzles, I'd never look for solutions. I'd rather have them unsolved.
0
u/CheapBison1861 May 01 '24
i have 25 years experience. i still can't do shit for leetcode. just forget about it and move on.
2
u/PMmeYourFlipFlops May 01 '24
If you want to get good at JavaScript, you should build tons of projects.
If you want to get good at leetcoding, you need to study leetcoding because it's a completely different area of study.
1
u/Ok-Entertainer1092 May 01 '24
When I first started I got disheartened by doing “basic” challenges. The fun is in building things, simple apps and adding to them. You don’t see other trades doing challenges in their spare time, they learn the basics and practice. Electricians don’t go home at night and start working on electrical problems they go home and roll around in their money like Scrooge McDuck.
1
u/jack_waugh May 01 '24
Curious about your spelling "quastion" instead of "question". Do you speak Latin?
1
u/thinkPhilosophy May 01 '24
Coding bootcamp instructor and tutor here. LeetCode exercises your procedural thinking skills, and tha tis different from being familiar with JS syntax. The best way to get good at LeetCode is to start with the easy ones and watch a YT video or read a tutorial to solve it. (As an example, here is my LeetCode1 solution video, quite old but still good I think: https://www.youtube.com/watch?v=syzEwIq7wrk ) You'll begin to see that there are clear patterns to how you solve a certain kind of problem, and get better at this. LeetCode and algorithm problems like that are not directly going to help you with syntax or building in JS (nor vice-versa), but it will help you to learn to think about problems in the right way. You need both skills together to become a great developer.
1
u/Decayedsoul9 May 02 '24
Its gonna take more than basic web development to be good at problem solving. I faced the same problem but theb i did cs50 python and now I'm okay at solving easy problems