Tuesday, August 3, 2010
Assingment: Case Study 11
If you have used any UI application, you would have seen that one control depends on the selection of the other. So let us say that you have three combo boxes Country, state and city on a webpage or a dialog. Country and state acts as filter for the city combo box. If the Country combo is changed the state and City combo has to be repopulated. How would you model this behavior? One possible solution is that City combo can register a listener for change in selection with Country and State Combo, what problems do you foresee? You can think of having 10 such controls that depend on each other to come up with a solution.
Assignment: case Study 10
You have been requested to write interrupt handler mechanism for a new OS. OS can allow for multiple handlers for same interrupt even though the processor may allow for just one. How would you model the interrupt hander mechanism to allow for multiple handlers for the interrupt? Don’t focus on efficiency, just think of multiple ways to achieve it.
Assignment:Case Study 9
A dialog is a kind of a window and so are text boxes, labels, listboxes and buttons. Each window can have child windows, child window means that life time of the child window is dependent on the parent window and child window can be placed anywhere on the parent window. Assume that a dialog has few controls like listbox, etc on it, you need to depict this relationship using…my symbols(or UML)…on a piece of paper
–If I want to go over all the controls and blink them, suggest me a way to do it. Blink can be achieved by just show-hide-show but think about how to iterate over the controls, if you are not using STL or any other standard container classes
–If I want to go over all the controls and blink them, suggest me a way to do it. Blink can be achieved by just show-hide-show but think about how to iterate over the controls, if you are not using STL or any other standard container classes
Monday, August 2, 2010
Assignment: Case Study 8
We have an inhouse C++ SDK that exposes fixed interface to read and write JPEG, TIFF & PDF files. There is a sniffer class that tells us which type of file type it is and based on that we create the instance of FileFormat (JPPEG, TIFF, PDF) class using a factory. The problem is that for PNG we have taken open source implementation and it doesn’t conform to our existing C++ interface. Please suggest what you believe is the best approach.
Assignment : Case Study 7
We have a neatly written application and all important classes are derived from one Abstract class and uses Factory method for creation. We are witnessing some performance issues so we need to find the time to execute the important functions of these classes and also log the in and out parameter. The log of parameters and time taken to execute the calls is independent, can be switched on and off separately. I suggested that we can change all these 20 classes with some #def code and put the relevant code. My Architect says that he doesn’t want to build unnecessary dependencies in main code and these can be selectively turned on customer side to fine tune the performance. Please suggest.
Sunday, August 1, 2010
Assignment: Case Study 6
We are using a third party image library and we wrapped it up in a clean c++ interface (One Abstrsact class with 15 functions) but during testing found that it is not thread safe and it is used at a lot of places. So my architect suggested that let us spawn an exe for each thread that wants to use it and kill the exe when the thread dies. He suggested that exe can take an XML that describes the operation that I want to invoke and the parameters, with the in and out image path. The problem is that I will have to change my code at lot places to achieve it and I don’t have a lot of time to make this change and test my module. What do you suggest?
Subscribe to:
Posts (Atom)