Glassdoor interview question

Google Maps allows you to zoom in and out of satellite maps, with terabytes of data accessible via a very fast interface. How would you go about implementing this functionality?

Interview Answer

Anonymous

19 Mar 2009

Luckily, before being asked this I had thought about this problem myself. I realized that when google maps re-drew, that it did so in patches. I mentioned that you would want to keep the back-end data in a tree of images, where each (zoomed out) image linked to multiple (zoomed in) patches that composed it. These patches, in turn, would link down to the next level of zoom. In order to draw quickly, this still required a lot of bandwidth. Google had that through their distributed data network. One way to give users a more responsive experience is to take advantage of the time a user spends looking at a map. While the user is simply looking, javascript code could be busy pre-loading all of the images that can be zoomed into one level down, as well as the images that comprise the zoom 'out'. All of this would require some very smart javascript, and it's not trivial, but when it's broken down to components, it's certainly feasible to see how it could be done.

6