Quantcast Interview Question

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