Day 91, Hack Reactor reflection

This would be an ongoing reflection of my Hack Reactor experience.

Overall score: 4/5

High level summary: first half is structured learning, and the second half is project-based learning. There are 18 sprints in the first half, each lasting 2 days. There are 2 projects in the second half, each lasting 3 weeks. Sprints are focused learning on one technical area, i.e. data structure, database, networking. Projects are simulated working, in which you worked with a team, under a deadline, and release regularly.

Marcus is definitely one of the best JavaScript instructors. The mere fact that he teaches for the first five weeks delivers enough value to cover the high tuition.

Classmates are smart and highly-motivated. That is the beauty of setting the tuition at a very high pricing point. The high pricing selects the best, and the most motivated people.

to be continued…


Day 90, this is the end

Everything has a beginning and an end. For Hack Reactor, this is the end…

Some last emails from Hack Reactor staffs reminding us to fill up one last survey, Tony making sure everyone is getting a t-shirt, emails reminding removing all your personal belongs from the cubby…

We had a bar this time. I guess our hiring went so well that the school decided to spend a little bit more money on the party. We had battle deck again. But it was not as exciting as last time. Marcus did a fantastic job mimicking Felix. What can’t he do?….

A indicator of how awesome the party is how many people will go to the after party. From that standing point, the party was definitely above average. Tons of people showed up for the after party in a nearby bar. That is when things got really interesting…The party was so good that I missed my bart and went to Barry’s place for couch surfing.

Oh, well, tomorrow will be another day.


Day 89, the second to last day

Interviews. Can’t say anything due to NDA.

It is strange that this is already the second to last day of the Hack Reactor class.

Quick math: $18000 / 90 days = $200 per day. Or in the preferred currency between me and my girlfriend, it would be buying one xbox per day. Wow, that is a lot of xboxes that we could have bought.

We were kidding that for every offer the student got, he should buy a six-pack of beer and bring it to the school. Then, by the end of the two week job hunting period, we will have enough beer for the graduation party. Too late for us, maybe next cohort.


Day 88, Python 101s

More interviews.

Some basic Python

# list comprehension
[x for x in range(9) if x%3 == 0]

# sum an array of numbers
# lazy version
arr = range(9)

# naive version
sum = 0
for x in arr:
  sum += x

# reduce version
reduce( (lambda x,y : x+y ), range(9) )


Day 87, closure in Python

Brush up Python for an interview.

Closure in Python. Yeah!

def outF(outArg):
  def innerF(innerArg):
    return outArg + innerArg
  return innerF

plusOne = outF(1)
plusTwo = outF(2)
print plusOne(10)
print plusTwo(10)

More things:
– more interviews
– get a parking ticket. Ouch!


Day 86, how to mimic closure

Question: how to mimic closure without using closure?

Answer: use bind.

The following code will work, inspired by the “Functional JavaScript”.

/* closure */
var multiply = function (byN) {
  return function(arg) {
    console.log('always multiply by ' + byN + ' because of closure. Result is: ', arg * byN);


var finalFunc = multiply(5);

In the code above, byN belongs to the scope of multiply(). In other words, byN is used by the anonymous function, and byN is outside the scope of that anonymous function. Hence, it is using closure.

/* mimicking using bind */
var _ = require('underscore');

var multiply = function (byN) {
  return function(arg) {
    var captures = {'byN': byN};

    var bindFn = _.bind(function(){
      console.log('always multiply by ' + this['byN'] + ' because of closure. Result is: ', arg * this['byN']);
    }, captures);


var finalFunc = multiply(5);

In the code above, byN belongs to the anonymous function. Hence, we are not using anything outside of the scope of the anonymous function.


Day 85, closure

More interviews. I guess having interview shouldn’t be news. If there were one day without an interview, that should be news.

Closure, closure, closure

Closure is a function that captures the external bindings (i.e. not its own arguments) contained in the scope, in which it was defined for later use (even after that scope has completed).

var outFn = function(){
  var closureVar = 'test';
  var inFn = function(arg){
    console.log('this is ' + closureVar + ' with ' + arg);
  return inFn;

var closureFn = outFn();
closureFn(' more args');

This is super basic sample. An nice StackOverflow article to read:

An even better one:


Day 84, techcrunch disrupt

Even though I was supposed to prepare for job interviews, I spent a lot of time watching the techcrunch disrupt. It is amazing. There were so many cool ideas.

I especially liked apps using APIs from cars. Tesla++ was amazing – if Tesla is parked and undercharged and not plugged in, it will send you a text to remind you. Wakey Wakey is also cool – if you are sleepy and begin to drift away, it will alert you “wakey, wakey”, and find the next coffee shop or hotel for you. Amazing!!!

Other cool ones are:
AdFree – use a JS to do map/reduce in visitors’ browser when visitors are visiting your blog. So the blogger can make money from computing instead of ads.


Group project reflection

Finally has time to sit down and reflect on the group project – PreLinked.


  • Best team ever. Stephen, Barry, Hao and I were just almost the best team I ever worked in. Nobody was a free rider and everybody was willing to help once he was done with his part. The skills were complementary too. I think some startup should hire four of us to be their entire frontend department.
  • Tech stack was solid. Backbone.js / MongoDB / Express.js were all main stream enough that there were enough documents on most problems we encountered.
  • “Promise” was good. I tried my best to teach everyone promises in the beginning of the project and by the end of the project, everyone was very comfortable with promises. Because of that, the asyn code was very readable.


  • Not enough time to reach out and publicize the project.
  • Could have been more aggressive in terms of scope.
  • Not enough testing.


  • Nothing really.