http://courses.csail.mit.edu/iap/interview/Hacking_a_Google_Interview_Practice_Questions_Person_A.pdf
Question: Text Editor
Describe a design for a text editor. Describe the classes, interfaces, and so on that you would use and how you would organize them.
Answer: There are so many possible answers to this problem that it would be difficult to say that one answer is the best.
Look to make sure that they make classes to set up a text editor (classes for the GUI, formatting, saving/loading files, handling input, etc.).
Using inheritance (subclassing in object‐oriented programming) where it makes sense is also good for reusability and extendability.
Using design patters (such as Model‐View‐Controller, Listener/Observer, or the Singleton pattern) is also a good thing. The main point is for them to get used to thinking about how they would design a system. Most importantly, they need to think about simplicity, reusability, and extendability in their design.
A text editor design question is slightly different from other design questions in that programmers often have strong feelings about how a text editor should work.
Programmers often want the ability to greatly modify the behavior of their editor and want to be able to write extensions that add functionality to it.
The major text editors used by programmers today, such as Emacs, Vim, Eclipse, and Visual Studio have this ability. A discussion about how their text editor would accomplish this (especially with how the design would include a place for extensions and how input would be handled) would be good.
Question: Text Editor
Describe a design for a text editor. Describe the classes, interfaces, and so on that you would use and how you would organize them.
Answer: There are so many possible answers to this problem that it would be difficult to say that one answer is the best.
Look to make sure that they make classes to set up a text editor (classes for the GUI, formatting, saving/loading files, handling input, etc.).
Using inheritance (subclassing in object‐oriented programming) where it makes sense is also good for reusability and extendability.
Using design patters (such as Model‐View‐Controller, Listener/Observer, or the Singleton pattern) is also a good thing. The main point is for them to get used to thinking about how they would design a system. Most importantly, they need to think about simplicity, reusability, and extendability in their design.
A text editor design question is slightly different from other design questions in that programmers often have strong feelings about how a text editor should work.
Programmers often want the ability to greatly modify the behavior of their editor and want to be able to write extensions that add functionality to it.
The major text editors used by programmers today, such as Emacs, Vim, Eclipse, and Visual Studio have this ability. A discussion about how their text editor would accomplish this (especially with how the design would include a place for extensions and how input would be handled) would be good.