Code snippet for some interview problems.