google interview questions (2007)

来源:百度文库 编辑:神马文学网 时间:2024/04/25 22:02:02
The interviewer was a guy called Rohit Fernandes. It started with myacademic projects. I chose to explain Wumpus World, as usual, which Ihave implemented in C++ for my OOPS course.. Then he startedquestioning me.
1. Tell the ways to represent a graph. Given a graph, find whether it is a tree or not.
2. Given a diagram which contains rectangles of different sizes thatmay overlap with each other and rectangles may be hidden. Discuss thedata structures to use to support this funcionality: When a rectangleis clicked, it should come into view on top of others, if it is hiddenalready. The overall aim is to reduce the amount of repainting to bedone everytime the user clicks on a rectangle.