Lightbits Labs Interview Question

fix a code and some memory question.