Solutions to various interview problems