Code for some interview problems