Quantcast interview question

They expected me to explain my code and asked questions on improving the code.