solve some interview problems