Intermediate Algorithm Scripting Struggles


HI everyone,

I recently started on the Intermediate Algorithm Scripting Bonfires and, man it is tough.

The first 288 FCC exercises have been pretty do-able, and a lot of fun to work on. But as of the Intermediate Algorithms it there seems to be a major increase in the difficulty of the bonfires. Honestly it is pretty demotivating. It looks like I have missed something along the line. I have tried to be more immersive by reading several JS books, which hasn't resulted in the expected result.

I would like to know if anybody else has experienced the same thing? How did you get through this?
Any tips, tricks, suggestions and experiences are welcome. I want to keep going, but without any progress it is pretty demotivating.

Please share.

Thanks a lot,


You haven't missed anything. This is exactly how it's supposed to go. Feeling demotivated, useless, and depressed is a normal part of the process. Some times you don't feel like you're making any progress or like you're going to fail, but you just push through and then one day, you wake up and you're much more capable than you used to be. But you'll never be as good as you want to be.

It's like everything else in life. One step at a time, forever more until the end of time.


Everybody hits walls where suddenly "it got hard". You are not alone. For me, it wasn't the algorithm challenges, it was the data visualization ones.

The trick with the algorithm challenges isn't knowing more JavaScript. It would totally make sense for that to be the fix, but the algorithm challenges aren't really so much about knowing JavaScript as they are about figuring out problems and designing solutions to those problems.

I would recommend signing up at HackerRank and then working through the challenges for the (archived) contests here and here. Those contests will start with very simple, "introduce you to JavaScript" type challenges for you to solve, and progress to increasingly more complex challenges which, I predict, would ease your journey through the FCC algorithms exercises. The "extra" bit that those Hacker Rank challenges will give you is that the contests I linked were a special "teach you javascript" two week series so each problem comes with a lot of background materials and videos explaining the concepts.


I'd recommend taking a break off of the books and simply focusing on solving the algorithms. It should be difficult, as it requires quite a bit of deep focus. When you can't figure the problem out after trying, you can try googling/looking up documentation/referring to your books(just for method ideas). If you still can't figure out the issue, you can always ask the FCC chat room / forums for help.

I know the struggle too. It's tough, but if you keep on grinding, you'll eventually succeed and crush those problems! :smile_cat:


Don't be afraid to visualize the problems! Often I use pen and paper to understand and break down the problem. I think one of the major downfalls of programmers are going straight into coding right after reading a problem.

Try, pausing, relaxing, talking to yourself, writing pseudocode, drawing on paper.


I've had some serious difficulty with the intermediate challenges. Here are some tactics that have helped me:
- If the problem feels really tough, I'll work it out with pen and paper first. This helps me plan out complex problems and break them down into manageable chunks.
- The MDN documentation is really useful for these challenges. To solve them, you're going to be using a lot of built in javascript methods for strings/objects/types/arrays etc. You can get a lot of mileage out of being familiar with the most common of these built in methods.
- If I've been struggling with a particular problem, sometimes I'll stop, and sleep on it, or skip it altogether and come back to it in the future. I just came back to a problem today after a week or two, and the solution was immediately apparent. Sometimes your brain just needs to "defrag" before it can come up with a solution - especially if you're tired.

I hope this helps.


Thanks for sharing the HackerRank link - I'd never heard of it before and I can already see that it's going to be super useful!!


You are not alone! :slight_smile:

As other have already said, pen and paper are very effective tools in tackling the intermediate and advanced challenges.


I'm glad you like it (hackerrank that is). It's a great site and those two contests do an awesome job of presenting JavaScript algorithm challenges along with a lot of supporting materials so it doesn't feel like you're being pushed into the deep end.

If you end up (I realize it's a long shot, but hey, anything's possible) hooked on algorithmic challenges like I am:

There's a whole ton of other straight up algorithm challenges (not JavaScript specific, but solvable in JavaScript) on the HackerRank site, plus the hold contests every so often. It may make me weird, but I love the "solve these 8 challenges in 24 hours" type contests.

My second favorite site for practicing algorithms is CodinGame. It also has a wide variety of algorithmic challenges varying from the super easy to the crazy difficult (plus contests from time to time). This one really shines in that it makes clear the types of tests your solution is going to need to pass which gives a lot of good exposure to testing - plus the interface is slick and the problems are interesting :wink:

Honorable mentions:
Code Wars - interesting primarily because once you solve one of the challenges, you can see the answers from everyone who solved it before, in an interactive forum setting where the solutions are ranked so you can see the "cream of the crop" rise to the top and maybe learn some new techniques.

Hacker Earth - It's not as pretty as some of the other sites, but it's algorithm challenges are top notch and it has something else the others lack: detailed walkthroughs on a wide variety of algorithm and data structures topics. I'd save this for last though, in the walkthroughs they typically use C++ (though you can solve the accompanying exercises in the language of your choice). The C++ is perfectly understandable, but it might be better to wait until JavaScript looks less foreign before reading a bunch of example code in the even more foreign C++.


Thank you SO much for all of this info. It's algorithms & data analysis that I am especially interested in & have been working towards learning (and one day mastering!) - so - thanks again! :eyeglasses:


gaahhhh! If you are having a problem getting the simple core client javascript here on FCC, then you will want to stick a gun in your mouth at HackerRank. They use server-side node.js javascript that will not look on vaguely familiar, you can't copy and paste the problems into your own editor and the tutorials are nearly useless because they are for Java coders. If you can make it through the HackerRank then you dang well deserve a job somewhere.


LOL. True! I heard about HackerRank and checked it out, became depressed, closed it. I mean, what the hell is all this???


var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");

function readLine() {
    return input_stdin_array[input_currentline++];

And this is level 1 EASY! I understand quite a lot of JS but when I saw this I felt like my brain was melting. Perfect example, (once again), of the coding community having now idea how to introduce new things to someone learning. You don't give a challenge that requires you to solve an algorithm as simple as, LITERALLY, "return a + b", and then throw a wall of confusion code at them like this and tell them:

Welcome to HackerRank! The purpose of this challenge is to familiarize you with reading input from stdin (the standard input stream) and writing output to stdout (the standard output stream) using our environment.

Review the code provided in the editor below, then complete the solveMeFirst function so that it returns the sum of two integers read from stdin. Take some time to understand this code so you're prepared to write it yourself in future challenges.

But I'm not surprised anymore. I actually think that professionals in any industry WANT to make the simple more complicated than it needs to be and WANT to confuse most people to create an artificial barrier to entry. Less competition. It sounds silly but I don't have a better explanation.

I like CodeFights and CodeWars the best. Maybe when I get better I'll go back to HackerRank. Maybe not. I'm pissed off that they call something like that "easy". LOL


You and Arowberry really had me laughing. I gave HackerRank a try. I woke up 3 days later, buried under a mountain of nodeJS documentation, attempting to understand the EASY HackerRank JS code challenges; after running down several coding rabbit trails, driven ever onward by my little girl need to compete with the guys, until at last I lay panting like an old dog under a hot summer sun.

My advice is to stay on point with FCC. The hardest part of learning JS seems to be adventuring off onto too many interesting looking rabbit trails until it all seems just too much. Thanks FCC for providing me a doable structure to follow!


"All this" is the code necessary to read data from standard input. place it in an array, and then iteratively retrieve one line at a time from the array so you can process each line one at a time by simply calling readLine() ... and, the links to the two beginner JavaScript contests I provided don't actually expect you to be able to code, or even understand that.

Typically, there will be a comment along the lines of:

    #put your code here

Which, I would expect to be understandable by most.

The two HackerRank links I offered up in this thread weren't actually "typical" toss you to the wolves algorithm challenges on HackerRank, they started with flat out basic JavaScript challenges, with a tutorial at the beginning of each lesson and the first lesson was as simple as looking for the "put your code here" comment and adding "Console.log('Hello World');" there.

Not all of HackerRank is unapproachable and I wouldn't have linked in their general consumption algorithm or data structures fare - that'd be a damn cruel thing to do to someone already feeling overwhelmed by the (relative to the general HackerRank challenges) far simpler challenges on FCC.

@RedMint - I'm not really sure the competitions on HackerRank have anything to do with gender. I've never found being female to be an asset or a hinderance there :wink:


The best way IMHO to tackle algorithms as a new programmer is to take a step back from the problem itself, grab a pen/pencil/marker, and define on a piece of paper the problem and how you are going to derive the answer. Don't look at the challenge as 1 problem, look at it as a a group of tiny problems. Breaking the challenge up into tiny problems helps you to think a little clearer. Every algorithm is just a list of steps, each step being the answer to a tiny problem.


tbh, we should have hint system so we wouldn't be urged to go out and look for documentation/answer.

A system where you get the option to take up to 3 slight hints would be very nice.


Something like that already exists:
I like to check it out after completing a challenge to measure my current density :slight_smile:


You used variations on the word "simple" three times. Quincy might have an opinion on that. LOL


True, but only in one of the cases did I use it in the "this is simple" sense. The other two were "relative" simples, as in "this" is as simple as "that" - of course, how simple "this" is is completely dependent on how hard you think "that" is. Besides, I'm not actually afraid that Quincy might have opinions different than mine - we disagree on a ton of stuff :slight_smile:

That aside - my message was "the hackerrank challenges I linked above aren't typical hackerrank fare, the hackerrank horror stories posted by others above don't actually apply to these links".


I also recently completed my JSON APIs and AJAX session and found it to be too non-educative (for lack of a better word). All I literally did in the last 5 challenges was copy the given code and paste it into the editor. It almost felt like FCC was rushing to the Intermediate Front End Development Projects.

So a frantic search began, to find what I'd missed. But to learn what I'd missed, I had to know what I had actually missed.

The quickest option was to chat with experienced developers in the, well, chat. This is the best comment I had there:

Yes, I feel that that section needs some love.

But all this did was to comfort me. This consoled me that I wasn't the only one having this problem. But, this did not solve my problem. It hadn't even started even solving my problem.

So the quest continued, I even posted this as a question on Quora, but no answer to my avail:
Why is the FreeCodeCamp curriculum for JSON APIs and AJAX so non educative. All it asks to do is paste the given code into the editor?

So, an angry me sent a direct message to Quincy Larson on Quora. In case you're wondering who he is, he is the founder of FreeCodeCamp. Still no reply.

To my rescue came Google, but as I said, to find the answer, I needed to know what I had to search. What should be the magic keyword?

After days of struggling, I finally found that what I need to learn was not APIs (although it requires APIs) but AJAX, which is pretty easy.

So, now that I knew what I had to learn, I needed a source to teach me AJAX as well as FreeCodeCamp teaches HTML, CSS and Javascript. With FCC, I had developed a bad habit of wanting a single source that when used, would render the need to consult other resources useless. Now I needed a similar course for AJAX.

After days of searching, Udacity was the angel from heaven.
Here's the link and don't forget to thank me later.
The ultimate source to learn AJAX.