Today was another one of those roller coaster ride of emotions days. It started off with our second self-assessment test, which I’m finding immensely stressful. They aren’t gated, meaning if you “fail” or do poorly, the onus is on you to improve in the areas you’re weak in.

I thought I actually did much better this time, even though my score was 18 out of 28. I made a pretty valiant attempt at every problem at least! The test basically asked us to write a number of functions from scratch.

- Add and remove items from a stack.
- Explain difference between a stack and a queue.
- Write a function to properly detect collisions when adding values to a hash table (and be able to resolve them.)
- Write a “reduce right” function that basically reverses the content of an array.
- Extend the JavaScript array object to be able to return the first and last items in an array by simply attaching a method.

One of the reasons I was dinged was that I left a bunch of debug code beneath one of my files. So when the automated testing system ran, it picked up the wrong values. Oops!

Of course, maybe if I put more time into writing better code, rather than witty comments inside my code, I’d do better…

  // This is going to be ugly, 
  // please forgive me computer gods.
  // Iterate through our list of arrays...
  // ...which is an array!
  for (var i=0; i < length; i++) {
    // Now, iterate over the elements
    // within a particular the array.

    for (var j=0; j < list[i]; j++) {
      // Call our iterator function 
      // and pust values into it
      result.push(iterator(list[length], list[length-1]));
    }
  }

Fortunately, the raw scores don’t mean too much. The self assessments are also examined by humans, too. So they can at least understand our ideas and then work with us directly if we aren’t understanding something (e.g., when they worked with me last week about recursion).

After this, we took part in a “sprint reflection.” Basically, we talk to Hack Reactor about what we liked and didn’t like about the most recent sprint and suggested ways to improve it. I think I wrote about this a few days ago when we first did it.

Then we went to our first lecture of the day (only one of two today!), where we learned about a new type of algorithm to tackle the “N-Queens” problem. Basically, given a chess board of n size, how many queens can you add before they are able to see each other within their range of movement.

Conceptually, it makes sense. But we were going to be lucky enough to get to implement a programmatic solution on our own. Oh, joy. Fun times were about to happen.

Before we left for lunch, we were able to do some initial solo coding and start working on the problem set for this particular sprint. I was able to tackle a few initial problems without much difficulty and even helped a few of my neighbors.

After lunch, we had a brief introduction to CSS and HTML, which most of us felt was a bit below our skill level and not an entirely good use of our time. I looked around the lecture hall and saw most people working on their N-Queens problem.

Fortunately, after this lecture ended at around 2:30pm, we had the entire rest of the day to code — from 2:30pm until the day ended at 8PM. This was a very exciting proposition and a lot of us felt that we’d be able to make some major progress with this problem set. (Ha ha ha ha…..)

Anyway, this is another sprint where they wanted to partner us up with someone of similar experience. They put a list of 10 questions on the screen and we lined up based on how many we were able to say yes to.

Last time, my ‘score’ was a 2 when I counted up all the answers I knew, and we know how that whole thing went. So this time, I counted up the number of questions I knew and maybe padded an answer or two with yes, and oh, sure I read about that one on Wikipedia one time.

So, this time, my score was a 5. A nice number that places me right in the middle of the pack. Coincidentally, there were a lot of other people who were also 5’s. Suspicious!

Anyway, after the brief introduction to our new pair programming partners, we were again thrown in the deep end of the pool. My new partner and I sat down and went to work.

Go figure, we immediately encountered difficulties with the problem set. Hack Reactor really makes you work hard to figure this stuff out and it can be such a demoralizing experience.

Basically, we were trying to implement a way to check whether any queens were in conflict (able to see each other) on a specific diagonal line. The code looked good but stuff kept failing some automated tests. Argggggh!

It sounds like a lot of others were having this issue too. The group next to us was stuck on the exact same problem. After 2 hours of trying various things, I suggested we skip this particular instance and just move on.

The second part of our problem set involves solving boards that the computer randomly generates and then asks us to try to put “x” number of chess pieces on the board without any conflicts.

We immediately ran into trouble with that too. We broke for dinner and then regrouped to tackle it.

The crazy thing is that we’ll just sit there and grind, spinning our wheels and not get anywhere. Then out of nowhere, one of us will have a brilliant, ingenious solution that we furiously code, only to find out that it doesn’t work either. This happened to both of us a number of times last night.

We end up drawing the problems out on some portable whiteboards — it really helps when trying to figure something out (and it’s why I’ve been taking so many pictures of whiteboards lately). Eventually, we’re able to figure out where we went wrong and can fix it.

So, after another 3 hours, we finally, finally, finally solved the major problem we’d been working on. It was awesome! I jumped up, high fived the people around me and gave my partner a hug. (People probably think I’m weird, but whatever — we’re here to learn and have a good time, too.) We also solved it right as we were getting ready to leave at 9:30PM.

(The crazy thing is that the entire class was still coding at 9:00PM, an hour after the day officially ended — I think that shows how focused everyone was on trying to understand this problem. It was really cool to see!)

There’s still a lot to do tomorrow, but we left feeling much better.