Lightbits Labs interview question

fix a code and some memory question.